codeOffunctionno test imports itfunction codeOf<K extends string>(list: { readonly [N in K]: Named; }, node: Named): K | undefinedThe key of a code list that names an individual, or nothing where none does.
What Ontology exports from elsewhere, so that its users need import nothing else.
codeOffunctionno test imports itfunction codeOf<K extends string>(list: { readonly [N in K]: Named; }, node: Named): K | undefinedThe key of a code list that names an individual, or nothing where none does.
formatRdfFindingfunctionno test imports itfunction formatRdfFinding(f: RdfFinding): stringThe sentence a finding is told with.
nTriplesfunctionno test imports itfunction nTriples(triples: readonly Triple[]): stringTriples as N-Triples: each once, one a line, the lines in the order of their code points.
triplesOffunctionfunction triplesOf(individuals: readonly AnyIndividual[]): readonly Triple[]The triples of individuals: each individual's statements in order, each triple once, where first stated.
turtlefunctionfunction turtle(doc: TurtleDocument): stringTriples as Turtle in its canonical form: the comment lines, then the prefixes sorted by name, then the subjects in the order of their N-Triples terms, each with its rdf:type first as a and its other predicates by IRI, each predicate's objects in the order of their N-Triples terms, one blank line between subjects. An IRI is a prefixed name where a prefix's IRI starts it and the rest is a plain local name (the longest such prefix), and a whole IRI otherwise; an integer or a boolean of canonical form is written bare.
validatefunctionfunction validate(individuals: readonly AnyIndividual[]): readonly RdfFinding[]Every finding about the individuals, in the order they are stated.
Iritypeno test imports ittype Iri = Brand<string, "rdf/Iri">;An absolute IRI, checked by parseIri or made from a namespace.
Namedtypeno test imports ittype Named<C extends string = never> = { readonly kind: "named"; readonly iri: Iri; readonly "@ifc/rdf-classes": Classes<C> };A named node: an IRI, branded with the classes its term is an individual of (by their CURIEs, "pm:PackageManager"). A Named<"a" | "b"> is an individual of both, so it is accepted where either is asked for; a Named<"a"> is not accepted where "b" is, and a Named of no known class (Named, which is Named<never>) is not accepted where any one class is asked for: every named node is a Named, so it is the type of a predicate or of any node at all.
Namespacetypeno test imports ittype Namespace<P extends string = string> = { readonly prefix: P; readonly iri: Iri };A namespace: a prefix and the IRI its terms' local names are appended to.
OntologyFiletypeno test imports ittype OntologyFile = {
readonly name: string;
readonly prefixes: readonly Namespace[];
readonly individuals: readonly AnyIndividual[];
};One file of an ontology: its name, the prefixes its Turtle may write, and the individuals it states, in order.
RdfFindingtypeno test imports ittype RdfFinding =
| { readonly kind: "not-an-integer"; readonly subject: Iri; readonly predicate: Iri; readonly value: number }
| {
readonly kind: "not-one-of";
readonly subject: Iri;
readonly predicate: Iri;
readonly value: string;
readonly words: readonly string[];
}
| { readonly kind: "stated-twice"; readonly subject: Iri };What a type cannot state about individuals (or what a run without the type checker lets through): an integer that is not a safe integer, a word not of its field's list, or a subject stated twice.
DCTERMSconstno test imports itconst DCTERMS: Namespace<"dcterms">The namespace of the Dublin Core terms.
OWLconstno test imports itconst OWL: Namespace<"owl">The namespace of OWL 2.
owlconstno test imports itconst owl: Vocabulary<"owl", { readonly Ontology: "rdfs:Class"; readonly Class: "rdfs:Class"; readonly ObjectProperty: "… (473 characters)const owl: Vocabulary<"owl", { readonly Ontology: "rdfs:Class"; readonly Class: "rdfs:Class"; readonly ObjectProperty: "rdfs:Class"; readonly DatatypeProperty: "rdfs:Class"; readonly AnnotationProperty: "rdfs:Class"; readonly NamedIndividual: "rdfs:Class"; readonly Thing: "rdfs:Class"; readonly versionInfo: "rdf:Property"; readonly versionIRI: "rdf:Property"; readonly imports: "rdf:Property"; readonly sameAs: "rdf:Property"; readonly equivalentClass: "rdf:Property"; }>The terms of owl: that commons states.
RDFSconstno test imports itconst RDFS: Namespace<"rdfs">The namespace of RDF Schema.
SKOSconstno test imports itconst SKOS: Namespace<"skos">The namespace of SKOS.
XSDconstno test imports itconst XSD: Namespace<"xsd">The namespace of the XML Schema datatypes.