Initial commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
pub(crate) mod ontology;
|
||||
pub(crate) mod term_helper;
|
||||
@@ -0,0 +1,154 @@
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
||||
@prefix dc: <http://purl.org/dc/elements/1.1/> .
|
||||
|
||||
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> a owl:Ontology ;
|
||||
dc:title "The RDF Concepts Vocabulary (RDF)" ;
|
||||
dc:date "2019-12-16" ;
|
||||
dc:description "This is the RDF Schema for the RDF vocabulary terms in the RDF Namespace, defined in RDF 1.1 Concepts." .
|
||||
|
||||
rdf:HTML a rdfs:Datatype ;
|
||||
rdfs:subClassOf rdfs:Literal ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:seeAlso <http://www.w3.org/TR/rdf11-concepts/#section-html> ;
|
||||
rdfs:label "HTML" ;
|
||||
rdfs:comment "The datatype of RDF literals storing fragments of HTML content" .
|
||||
|
||||
rdf:langString a rdfs:Datatype ;
|
||||
rdfs:subClassOf rdfs:Literal ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:seeAlso <http://www.w3.org/TR/rdf11-concepts/#section-Graph-Literal> ;
|
||||
rdfs:label "langString" ;
|
||||
rdfs:comment "The datatype of language-tagged string values" .
|
||||
|
||||
rdf:PlainLiteral a rdfs:Datatype ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:subClassOf rdfs:Literal ;
|
||||
rdfs:seeAlso <http://www.w3.org/TR/rdf-plain-literal/> ;
|
||||
rdfs:label "PlainLiteral" ;
|
||||
rdfs:comment "The class of plain (i.e. untyped) literal values, as used in RIF and OWL 2" .
|
||||
|
||||
rdf:type a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "type" ;
|
||||
rdfs:comment "The subject is an instance of a class." ;
|
||||
rdfs:range rdfs:Class ;
|
||||
rdfs:domain rdfs:Resource .
|
||||
|
||||
rdf:Property a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "Property" ;
|
||||
rdfs:comment "The class of RDF properties." ;
|
||||
rdfs:subClassOf rdfs:Resource .
|
||||
|
||||
rdf:Statement a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "Statement" ;
|
||||
rdfs:subClassOf rdfs:Resource ;
|
||||
rdfs:comment "The class of RDF statements." .
|
||||
|
||||
rdf:subject a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "subject" ;
|
||||
rdfs:comment "The subject of the subject RDF statement." ;
|
||||
rdfs:domain rdf:Statement ;
|
||||
rdfs:range rdfs:Resource .
|
||||
|
||||
rdf:predicate a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "predicate" ;
|
||||
rdfs:comment "The predicate of the subject RDF statement." ;
|
||||
rdfs:domain rdf:Statement ;
|
||||
rdfs:range rdfs:Resource .
|
||||
|
||||
rdf:object a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "object" ;
|
||||
rdfs:comment "The object of the subject RDF statement." ;
|
||||
rdfs:domain rdf:Statement ;
|
||||
rdfs:range rdfs:Resource .
|
||||
|
||||
rdf:Bag a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "Bag" ;
|
||||
rdfs:comment "The class of unordered containers." ;
|
||||
rdfs:subClassOf rdfs:Container .
|
||||
|
||||
rdf:Seq a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "Seq" ;
|
||||
rdfs:comment "The class of ordered containers." ;
|
||||
rdfs:subClassOf rdfs:Container .
|
||||
|
||||
rdf:Alt a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "Alt" ;
|
||||
rdfs:comment "The class of containers of alternatives." ;
|
||||
rdfs:subClassOf rdfs:Container .
|
||||
|
||||
rdf:value a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "value" ;
|
||||
rdfs:comment "Idiomatic property used for structured values." ;
|
||||
rdfs:domain rdfs:Resource ;
|
||||
rdfs:range rdfs:Resource .
|
||||
|
||||
rdf:List a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "List" ;
|
||||
rdfs:comment "The class of RDF Lists." ;
|
||||
rdfs:subClassOf rdfs:Resource .
|
||||
|
||||
rdf:nil a rdf:List ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "nil" ;
|
||||
rdfs:comment "The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it." .
|
||||
|
||||
rdf:first a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "first" ;
|
||||
rdfs:comment "The first item in the subject RDF list." ;
|
||||
rdfs:domain rdf:List ;
|
||||
rdfs:range rdfs:Resource .
|
||||
|
||||
rdf:rest a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "rest" ;
|
||||
rdfs:comment "The rest of the subject RDF list after the first item." ;
|
||||
rdfs:domain rdf:List ;
|
||||
rdfs:range rdf:List .
|
||||
|
||||
rdf:XMLLiteral a rdfs:Datatype ;
|
||||
rdfs:subClassOf rdfs:Literal ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:label "XMLLiteral" ;
|
||||
rdfs:comment "The datatype of XML literal values." .
|
||||
|
||||
rdf:JSON a rdfs:Datatype ;
|
||||
rdfs:label "JSON" ;
|
||||
rdfs:comment "The datatype of RDF literals storing JSON content." ;
|
||||
rdfs:subClassOf rdfs:Literal ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:seeAlso <https://www.w3.org/TR/json-ld11/#the-rdf-json-datatype> .
|
||||
|
||||
rdf:CompoundLiteral a rdfs:Class ;
|
||||
rdfs:label "CompoundLiteral" ;
|
||||
rdfs:comment "A class representing a compound literal." ;
|
||||
rdfs:subClassOf rdfs:Resource ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:seeAlso <https://www.w3.org/TR/json-ld11/#the-rdf-compoundliteral-class-and-the-rdf-language-and-rdf-direction-properties> .
|
||||
|
||||
rdf:language a rdf:Property ;
|
||||
rdfs:label "language" ;
|
||||
rdfs:comment "The language component of a CompoundLiteral." ;
|
||||
rdfs:domain rdf:CompoundLiteral ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:seeAlso <https://www.w3.org/TR/json-ld11/#the-rdf-compoundliteral-class-and-the-rdf-language-and-rdf-direction-properties> .
|
||||
|
||||
rdf:direction a rdf:Property ;
|
||||
rdfs:label "direction" ;
|
||||
rdfs:comment "The base direction component of a CompoundLiteral." ;
|
||||
rdfs:domain rdf:CompoundLiteral ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;
|
||||
rdfs:seeAlso <https://www.w3.org/TR/json-ld11/#the-rdf-compoundliteral-class-and-the-rdf-language-and-rdf-direction-properties> .
|
||||
@@ -0,0 +1,515 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type="text/xsl" href="owl2html.xsl"?>
|
||||
|
||||
<!DOCTYPE rdf:RDF [
|
||||
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
|
||||
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
|
||||
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
|
||||
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
|
||||
]>
|
||||
|
||||
|
||||
<rdf:RDF xmlns="http://fedora.info/definitions/v4/repository#"
|
||||
xml:base="http://fedora.info/definitions/v4/repository"
|
||||
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
|
||||
xmlns:owl="http://www.w3.org/2002/07/owl#"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<owl:Ontology rdf:about="http://fedora.info/definitions/v4/repository#">
|
||||
<rdfs:label xml:lang="en">Fedora Commons Repository Ontology</rdfs:label>
|
||||
<rdfs:comment xml:lang="en">Ontology for the Fedora data model, intended primarily to make it possible to expose Fedora-curated RDF predicates via de-reference-able URIs.</rdfs:comment>
|
||||
<owl:versionInfo>v4/2016/10/18</owl:versionInfo>
|
||||
<owl:priorVersion rdf:resource="http://fedora.info/definitions/v4/2016/03/01/repository" />
|
||||
</owl:Ontology>
|
||||
|
||||
|
||||
<!--
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Data properties
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#computedChecksum -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#computedChecksum">
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#computedSize -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#computedSize">
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#couldNotStoreProperty -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#couldNotStoreProperty">
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#created -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#created">
|
||||
<rdfs:range rdf:resource="&xsd;dateTime"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#createdBy -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#createdBy">
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#hasLocation -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#hasLocation">
|
||||
<rdfs:range rdf:resource="&xsd;anyURI"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#hasVersionLabel -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#hasVersionLabel">
|
||||
<rdfs:range rdf:resource="&xsd;string"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#isCheckedOut -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#isCheckedOut">
|
||||
<rdfs:range rdf:resource="&xsd;boolean"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#lastModified -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#lastModified">
|
||||
<rdfs:range rdf:resource="&xsd;dateTime"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#lastModifiedBy -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#lastModifiedBy">
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#numFixityChecks -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#numFixityChecks">
|
||||
<rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#numFixityErrors -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#numFixityErrors">
|
||||
<rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#numFixityRepaired -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#numFixityRepaired">
|
||||
<rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#numberOfChildren -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#numberOfChildren">
|
||||
<rdfs:range rdf:resource="&xsd;nonNegativeInteger"/>
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#objectCount -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#objectCount">
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#objectSize -->
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#objectSize">
|
||||
<rdfs:subPropertyOf rdf:resource="&owl;topDataProperty"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Object Properties
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#baseVersion -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#baseVersion">
|
||||
<rdf:type rdf:resource="&owl;FunctionalProperty"/>
|
||||
<rdfs:label xml:lang="en">base version</rdfs:label>
|
||||
<rdfs:domain rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
<rdfs:range rdf:resource="http://fedora.info/definitions/v4/repository#Version"/>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#hasChild -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasChild">
|
||||
<rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
|
||||
<rdfs:label xml:lang="en">has child</rdfs:label>
|
||||
<rdfs:domain rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
<rdfs:range>
|
||||
<owl:Class>
|
||||
<owl:unionOf rdf:parseType="Collection">
|
||||
<rdf:Description rdf:about="http://fedora.info/definitions/v4/repository#NonRdfSourceDescription"/>
|
||||
<rdf:Description rdf:about="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
</owl:unionOf>
|
||||
</owl:Class>
|
||||
</rdfs:range>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#hasContent -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasContent">
|
||||
<rdfs:label xml:lang="en">has content</rdfs:label>
|
||||
<rdfs:comment xml:lang="en">Indicates a binary in which content is stored for this datastream.</rdfs:comment>
|
||||
<rdfs:range rdf:resource="http://fedora.info/definitions/v4/repository#Binary"/>
|
||||
<rdfs:domain rdf:resource="http://fedora.info/definitions/v4/repository#NonRdfSourceDescription"/>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#hasMember -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasMember">
|
||||
<rdfs:label xml:lang="en">has member</rdfs:label>
|
||||
<rdfs:comment xml:lang="en">Links to a newly-minted identifier which can be used to create a repository resource.</rdfs:comment>
|
||||
<rdfs:range rdf:resource="&xsd;anyURI"/>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#hasParent -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasParent">
|
||||
<rdf:type rdf:resource="&owl;FunctionalProperty"/>
|
||||
<rdfs:label xml:lang="en">has parent</rdfs:label>
|
||||
<rdfs:range rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
<rdfs:domain rdf:resource="http://fedora.info/definitions/v4/repository#Resource"/>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#hasResultsMember -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasResultsMember">
|
||||
<rdfs:label xml:lang="en">has results member</rdfs:label>
|
||||
<rdfs:range rdf:resource="http://fedora.info/definitions/v4/repository#Resource"/>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#hasVersion -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasVersion">
|
||||
<rdfs:label xml:lang="en">has version</rdfs:label>
|
||||
<rdfs:domain rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
<rdfs:range rdf:resource="http://fedora.info/definitions/v4/repository#Version"/>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#isContentOf -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#isContentOf">
|
||||
<rdf:type rdf:resource="&owl;InverseFunctionalProperty"/>
|
||||
<rdfs:label xml:lang="en">is content of</rdfs:label>
|
||||
<rdfs:comment xml:lang="en">Indicates a datastream for which this resource contains the content. </rdfs:comment>
|
||||
<rdfs:domain rdf:resource="http://fedora.info/definitions/v4/repository#Binary"/>
|
||||
<rdfs:range rdf:resource="http://fedora.info/definitions/v4/repository#NonRdfSourceDescription"/>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#predecessors -->
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#predecessors">
|
||||
<rdfs:label xml:lang="en">predecessors</rdfs:label>
|
||||
<rdfs:range rdf:resource="http://fedora.info/definitions/v4/repository#Version"/>
|
||||
<rdfs:domain rdf:resource="http://fedora.info/definitions/v4/repository#Version"/>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Classes
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#AnnotatedResource -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#AnnotatedResource">
|
||||
<rdfs:label xml:lang="en">annotated resource</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Resource"/>
|
||||
<rdfs:comment xml:lang="en">A Resource that maintains properties in its own right.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Binary -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Binary">
|
||||
<rdfs:label xml:lang="en">binary</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Resource"/>
|
||||
<owl:disjointWith rdf:resource="http://fedora.info/definitions/v4/repository#NonRdfSourceDescription"/>
|
||||
<owl:disjointWith rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
<rdfs:comment xml:lang="en">A bitstream, with no further data properties.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#RepositoryRoot -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#RepositoryRoot">
|
||||
<rdfs:label xml:lang="en">repository root</rdfs:label>
|
||||
<owl:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
<rdfs:comment xml:lang="en">A repository root.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Skolem -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Skolem">
|
||||
<rdfs:label xml:lang="en">skolem</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Thing"/>
|
||||
<rdfs:comment xml:lang="en">An entity that is a representation of an RDF Skolem node.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Configuration -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Configuration">
|
||||
<rdfs:label xml:lang="en">Fedora configuration</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Thing"/>
|
||||
<rdfs:comment xml:lang="en">A container for a Fedora configuration.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#NonRdfSourceDescription -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#NonRdfSourceDescription">
|
||||
<rdfs:label xml:lang="en">Fedora NonRdfSourceDescription</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#AnnotatedResource"/>
|
||||
<owl:disjointWith rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
<rdfs:comment xml:lang="en">A container for a bitstream and associated properties.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#EmbedResources -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#EmbedResources">
|
||||
<rdfs:label xml:lang="en">embed resources</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Thing"/>
|
||||
<rdfs:comment xml:lang="en">The set of triples representing child resources of a given resource.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#InboundReferences -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#InboundReferences">
|
||||
<rdfs:label xml:lang="en">inbound references</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Thing"/>
|
||||
<rdfs:comment xml:lang="en">The set of triples representing other repository resources which link to a given resource.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Container -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Container">
|
||||
<rdfs:label xml:lang="en">Fedora Container</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#AnnotatedResource"/>
|
||||
<rdfs:comment xml:lang="en">A Fedora Container: the fundamental quantum of durable content in a Fedora repository.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Pairtree -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Pairtree">
|
||||
<rdfs:label xml:lang="en">pair tree</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Thing"/>
|
||||
<rdfs:comment xml:lang="en">An entity that is a an intermediary node created in a PairTree hierarchy.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Relations -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Relations">
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Thing"/>
|
||||
<rdfs:comment xml:lang="en">An entity that may be related to other repository entities.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Resource -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Resource">
|
||||
<rdfs:label xml:lang="en">Fedora resource</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Thing"/>
|
||||
<rdfs:comment xml:lang="en">An entity that has been committed to the repository for safekeeping. For example, Fedora objects and datastreams are resources. A Fixity is not, because the provenance of the instance is entirely internal to the repository.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#ServerManaged -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#ServerManaged">
|
||||
<rdfs:label xml:lang="en">server managed</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Thing"/>
|
||||
<rdfs:comment xml:lang="en">The system-generated triples for a given resource (as opposed to explicity-declared properties).</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Thing -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Thing">
|
||||
<rdfs:label xml:lang="en">Fedora thing</rdfs:label>
|
||||
<rdfs:comment xml:lang="en">Something that is contemplated in the Fedora repository model.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Tombstone -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Tombstone">
|
||||
<rdfs:label xml:lang="en">tombstone</rdfs:label>
|
||||
<rdfs:comment xml:lang="en">An entity that is a marker for a deleted node.</rdfs:comment>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#Version -->
|
||||
|
||||
<owl:Class rdf:about="http://fedora.info/definitions/v4/repository#Version">
|
||||
<rdfs:label xml:lang="en">A snapshot of a Fedora object at a given point in time.</rdfs:label>
|
||||
<rdfs:subClassOf rdf:resource="http://fedora.info/definitions/v4/repository#Container"/>
|
||||
</owl:Class>
|
||||
|
||||
|
||||
<!--
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Individuals
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
|
||||
<!-- http://fedora.info/definitions/v4/repository#inaccessibleResource -->
|
||||
|
||||
<owl:NamedIndividual rdf:about="http://fedora.info/definitions/v4/repository#inaccessibleResource">
|
||||
<rdfs:label xml:lang="en">inaccessible resource</rdfs:label>
|
||||
<rdfs:comment xml:lang="en">A Fedora resource that is inaccessible.</rdfs:comment>
|
||||
</owl:NamedIndividual>
|
||||
|
||||
|
||||
<!--
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REST API
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasAccessRoles">
|
||||
<rdfs:label xml:lang="en">has access roles</rdfs:label>
|
||||
</owl:ObjectProperty>
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasFixityService">
|
||||
<rdfs:label xml:lang="en">has fixity service</rdfs:label>
|
||||
</owl:ObjectProperty>
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasNamespaces">
|
||||
<rdfs:label xml:lang="en">has namespaces</rdfs:label>
|
||||
</owl:ObjectProperty>
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#hasVersions">
|
||||
<rdfs:label xml:lang="en">has versions</rdfs:label>
|
||||
</owl:ObjectProperty>
|
||||
<owl:ObjectProperty rdf:about="http://fedora.info/definitions/v4/repository#sparql">
|
||||
<rdfs:label xml:lang="en">has sparql service</rdfs:label>
|
||||
</owl:ObjectProperty>
|
||||
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#hasMoreResults">
|
||||
<rdfs:label xml:lang="en">has more results</rdfs:label>
|
||||
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
|
||||
</owl:DatatypeProperty>
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#hasTransactionProvider">
|
||||
<rdfs:label xml:lang="en">has transaction provider</rdfs:label>
|
||||
</owl:DatatypeProperty>
|
||||
<owl:DatatypeProperty rdf:about="http://fedora.info/definitions/v4/repository#writable">
|
||||
<rdfs:label xml:lang="en">writable</rdfs:label>
|
||||
<rdfs:comment>Whether or not the resource with this representation could have been altered by the same agent that received this representation if the request that retrieved this representation had been a mutating request.</rdfs:comment>
|
||||
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/>
|
||||
</owl:DatatypeProperty>
|
||||
|
||||
</rdf:RDF>
|
||||
|
||||
|
||||
|
||||
<!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net -->
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
# See details within this document for linkage to specification and purpose.
|
||||
# This ontology file is a non-normative supporting document.
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
|
||||
@prefix owl: <http://www.w3.org/2002/07/owl#>.
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
|
||||
@prefix dcterms: <http://purl.org/dc/terms/>.
|
||||
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
|
||||
@prefix vann: <http://purl.org/vocab/vann/> .
|
||||
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
||||
@prefix : <http://www.w3.org/ns/ldp#>.
|
||||
|
||||
:
|
||||
a owl:Ontology;
|
||||
dcterms:description "Vocabulary URIs defined in the Linked Data Platform (LDP) namespace.";
|
||||
dcterms:title "The W3C Linked Data Platform (LDP) Vocabulary";
|
||||
rdfs:label "W3C Linked Data Platform (LDP)";
|
||||
rdfs:comment "This ontology provides an informal representation of the concepts and terms as defined in the LDP specification. Consult the LDP specification for normative reference.";
|
||||
dcterms:publisher <http://www.w3.org/data#W3C>;
|
||||
dcterms:creator [foaf:name "Steve Speicher"], [foaf:name "John Arwe"], [foaf:name "Ashok Malhotra"];
|
||||
foaf:maker [foaf:homepage <http://www.w3.org/2012/ldp>];
|
||||
dcterms:created "2015-02-26"^^xsd:date;
|
||||
vann:preferredNamespaceUri "http://www.w3.org/ns/ldp#";
|
||||
vann:preferredNamespacePrefix "ldp";
|
||||
rdfs:seeAlso <http://www.w3.org/2012/ldp>,
|
||||
<http://www.w3.org/TR/ldp-ucr/>,
|
||||
<http://www.w3.org/TR/ldp/>,
|
||||
<http://www.w3.org/TR/ldp-paging/>,
|
||||
<http://www.w3.org/2011/09/LinkedData/>.
|
||||
|
||||
:Resource
|
||||
a rdfs:Class;
|
||||
rdfs:comment "A HTTP-addressable resource whose lifecycle is managed by a LDP server.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "Resource".
|
||||
|
||||
:RDFSource
|
||||
a rdfs:Class;
|
||||
rdfs:subClassOf :Resource;
|
||||
rdfs:comment "A Linked Data Platform Resource (LDPR) whose state is represented as RDF.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "RDFSource".
|
||||
|
||||
:NonRDFSource
|
||||
a rdfs:Class;
|
||||
rdfs:subClassOf :Resource;
|
||||
rdfs:comment "A Linked Data Platform Resource (LDPR) whose state is NOT represented as RDF.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "NonRDFSource".
|
||||
|
||||
:Container
|
||||
a rdfs:Class;
|
||||
rdfs:subClassOf :RDFSource;
|
||||
rdfs:comment "A Linked Data Platform RDF Source (LDP-RS) that also conforms to additional patterns and conventions for managing membership. Readers should refer to the specification defining this ontology for the list of behaviors associated with it.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "Container".
|
||||
|
||||
:BasicContainer
|
||||
a rdfs:Class;
|
||||
rdfs:subClassOf :Container;
|
||||
rdfs:comment "An LDPC that uses a predefined predicate to simply link to its contained resources.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "BasicContainer".
|
||||
|
||||
:DirectContainer
|
||||
a rdfs:Class;
|
||||
rdfs:subClassOf :Container;
|
||||
rdfs:comment "An LDPC that is similar to a LDP-DC but it allows an indirection with the ability to list as member a resource, such as a URI representing a real-world object, that is different from the resource that is created.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "DirectContainer".
|
||||
|
||||
:IndirectContainer
|
||||
a rdfs:Class;
|
||||
rdfs:subClassOf :Container;
|
||||
rdfs:comment "An LDPC that has the flexibility of choosing what form the membership triples take.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "IndirectContainer".
|
||||
|
||||
:hasMemberRelation
|
||||
a rdf:Property;
|
||||
rdfs:comment "Indicates which predicate is used in membership triples, and that the membership triple pattern is < membership-constant-URI , object-of-hasMemberRelation, member-URI >.";
|
||||
vs:term_status "stable";
|
||||
rdfs:domain :Container;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "hasMemberRelation";
|
||||
rdfs:range rdf:Property.
|
||||
|
||||
:isMemberOfRelation
|
||||
a rdf:Property;
|
||||
rdfs:comment "Indicates which predicate is used in membership triples, and that the membership triple pattern is < member-URI , object-of-isMemberOfRelation, membership-constant-URI >.";
|
||||
vs:term_status "stable";
|
||||
rdfs:domain :Container;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "isMemmberOfRelation";
|
||||
rdfs:range rdf:Property.
|
||||
|
||||
:membershipResource
|
||||
a rdf:Property;
|
||||
rdfs:comment "Indicates the membership-constant-URI in a membership triple. Depending upon the membership triple pattern a container uses, as indicated by the presence of ldp:hasMemberRelation or ldp:isMemberOfRelation, the membership-constant-URI might occupy either the subject or object position in membership triples.";
|
||||
vs:term_status "stable";
|
||||
rdfs:domain :Container;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "membershipResource";
|
||||
rdfs:range rdfs:Resource.
|
||||
|
||||
:insertedContentRelation
|
||||
a rdf:Property;
|
||||
rdfs:comment "Indicates which triple in a creation request should be used as the member-URI value in the membership triple added when the creation request is successful.";
|
||||
vs:term_status "stable";
|
||||
rdfs:domain :Container;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "insertedContentRelation";
|
||||
rdfs:range rdf:Property.
|
||||
|
||||
:member
|
||||
a rdf:Property;
|
||||
rdfs:comment "LDP servers should use this predicate as the membership predicate if there is no obvious predicate from an application vocabulary to use.";
|
||||
vs:term_status "stable";
|
||||
rdfs:domain :Resource;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "member";
|
||||
rdfs:range rdfs:Resource.
|
||||
|
||||
:contains
|
||||
a rdf:Property;
|
||||
rdfs:comment "Links a container with resources created through the container.";
|
||||
vs:term_status "stable";
|
||||
rdfs:domain :Container;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "contains";
|
||||
rdfs:range rdfs:Resource.
|
||||
|
||||
:MemberSubject
|
||||
a owl:Individual;
|
||||
rdfs:comment "Used to indicate default and typical behavior for ldp:insertedContentRelation, where the member-URI value in the membership triple added when a creation request is successful is the URI assigned to the newly created resource.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "MemberSubject".
|
||||
|
||||
:PreferContainment
|
||||
a owl:Individual;
|
||||
rdfs:comment "URI identifying a LDPC's containment triples, for example to allow clients to express interest in receiving them.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "PreferContainment".
|
||||
|
||||
:PreferMembership
|
||||
a owl:Individual;
|
||||
rdfs:comment "URI identifying a LDPC's membership triples, for example to allow clients to express interest in receiving them.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "PreferMembership".
|
||||
|
||||
:PreferEmptyContainer
|
||||
a owl:Individual;
|
||||
rdfs:comment "Archaic alias for ldp:PreferMinimalContainer";
|
||||
vs:term_status "archaic";
|
||||
rdfs:isDefinedBy :;
|
||||
owl:equivalentProperty :PreferMinimalContainer;
|
||||
rdfs:seeAlso :PreferMinimalContainer;
|
||||
rdfs:label "PreferEmptyContainer".
|
||||
|
||||
:PreferMinimalContainer
|
||||
a owl:Individual;
|
||||
rdfs:comment "URI identifying the subset of a LDPC's triples present in an empty LDPC, for example to allow clients to express interest in receiving them. Currently this excludes containment and membership triples, but in the future other exclusions might be added. This definition is written to automatically exclude those new classes of triples.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "PreferMinimalContainer".
|
||||
|
||||
:constrainedBy
|
||||
a rdf:Property;
|
||||
rdfs:comment "Links a resource with constraints that the server requires requests like creation and update to conform to.";
|
||||
vs:term_status "stable";
|
||||
rdfs:domain :Resource;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "constrainedBy";
|
||||
rdfs:range rdfs:Resource.
|
||||
|
||||
:pageSortCriteria
|
||||
a rdf:Property;
|
||||
rdfs:comment "Link to the list of sorting criteria used by the server in a representation. Typically used on Link response headers as an extension link relation URI in the rel= parameter.";
|
||||
vs:term_status "testing";
|
||||
rdfs:domain :Page;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "pageSortCriteria";
|
||||
rdfs:range rdf:List.
|
||||
|
||||
:PageSortCriterion
|
||||
a rdfs:Class;
|
||||
rdfs:comment "Element in the list of sorting criteria used by the server to assign container members to pages.";
|
||||
vs:term_status "testing";
|
||||
rdfs:label "PageSortCriterion";
|
||||
rdfs:isDefinedBy :.
|
||||
|
||||
:pageSortPredicate
|
||||
a rdf:Property;
|
||||
rdfs:comment "Predicate used to specify the order of the members across a page sequence's in-sequence page resources; it asserts nothing about the order of members in the representation of a single page.";
|
||||
vs:term_status "testing";
|
||||
rdfs:domain :PageSortCriterion;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "pageSortPredicate";
|
||||
rdfs:range rdf:Property.
|
||||
|
||||
:pageSortOrder
|
||||
a rdf:Property;
|
||||
rdfs:comment "The ascending/descending/etc order used to order the members across pages in a page sequence.";
|
||||
vs:term_status "testing";
|
||||
rdfs:domain :PageSortCriterion;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "pageSortOrder";
|
||||
rdfs:range rdf:Resource.
|
||||
|
||||
:pageSortCollation
|
||||
a rdf:Property;
|
||||
rdfs:comment "The collation used to order the members across pages in a page sequence when comparing strings.";
|
||||
vs:term_status "testing";
|
||||
rdfs:domain :PageSortCriterion;
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "pageSortCollation";
|
||||
rdfs:range rdf:Property.
|
||||
|
||||
:Ascending
|
||||
a owl:Individual;
|
||||
rdfs:comment "Ascending order.";
|
||||
vs:term_status "testing";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "Ascending".
|
||||
|
||||
:Descending
|
||||
a owl:Individual;
|
||||
rdfs:comment "Descending order.";
|
||||
vs:term_status "testing";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "Descending".
|
||||
|
||||
:Page
|
||||
a rdfs:Class;
|
||||
rdfs:comment "URI signifying that the resource is an in-sequence page resource, as defined by LDP Paging. Typically used on Link rel='type' response headers.";
|
||||
vs:term_status "testing";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "Page".
|
||||
|
||||
:pageSequence
|
||||
a rdf:Property;
|
||||
rdfs:comment "Link to a page sequence resource, as defined by LDP Paging. Typically used to communicate the sorting criteria used to allocate LDPC members to pages.";
|
||||
vs:term_status "testing";
|
||||
rdfs:isDefinedBy :;
|
||||
rdfs:label "Page".
|
||||
|
||||
:inbox
|
||||
a rdf:Property;
|
||||
rdfs:comment "Links a resource to a container where notifications for the resource can be created and discovered.";
|
||||
vs:term_status "stable";
|
||||
rdfs:isDefinedBy <https://www.w3.org/TR/ldn/>;
|
||||
rdfs:label "inbox";
|
||||
dcterms:issued "2016-09-29"^^xsd:date;
|
||||
dcterms:creator <http://csarven.ca/#i>, <https://rhiaro.co.uk/#me>.
|
||||
@@ -0,0 +1,410 @@
|
||||
@prefix : <https://graphofliberty.org/2026/04/ont/> .
|
||||
@prefix ldp: <http://www.w3.org/ns/ldp#> .
|
||||
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
|
||||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
||||
@prefix rdaa: <http://rdaregistry.info/Elements/a/> .
|
||||
@prefix rdac: <http://rdaregistry.info/Elements/c/> .
|
||||
@prefix rdae: <http://rdaregistry.info/Elements/e/> .
|
||||
@prefix rdai: <http://rdaregistry.info/Elements/i/> .
|
||||
@prefix rdam: <http://rdaregistry.info/Elements/m/> .
|
||||
@prefix rdan: <http://rdaregistry.info/Elements/n/> .
|
||||
@prefix rdap: <http://rdaregistry.info/Elements/p/> .
|
||||
@prefix rdat: <http://rdaregistry.info/Elements/t/> .
|
||||
@prefix rdaw: <http://rdaregistry.info/Elements/w/> .
|
||||
@prefix rdax: <http://rdaregistry.info/Elements/x/> .
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
@prefix fedora: <http://fedora.info/definitions/v4/repository#> .
|
||||
@base <https://graphofliberty.org/2026/04/ont/> .
|
||||
|
||||
<https://graphofliberty.org/2026/04/ont> rdf:type owl:Ontology .
|
||||
|
||||
#################################################################
|
||||
# Annotation properties
|
||||
#################################################################
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/catalogId
|
||||
:catalogId rdf:type owl:AnnotationProperty ;
|
||||
rdfs:comment "An integer associated with the class for fast lookup in a database."@en ;
|
||||
rdfs:label "catalog id" ;
|
||||
rdfs:domain owl:Class .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/indexedByField
|
||||
:indexedByField rdf:type owl:AnnotationProperty ;
|
||||
rdfs:comment "The property is associated with the given field in a full-text search database."@en ;
|
||||
rdfs:label "indexed by field"@en ;
|
||||
rdfs:domain owl:DatatypeProperty .
|
||||
|
||||
|
||||
#################################################################
|
||||
# Datatypes
|
||||
#################################################################
|
||||
|
||||
### http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString
|
||||
rdf:dirLangString rdf:type rdfs:Datatype ;
|
||||
rdfs:label "Directional language-tagged string"@en .
|
||||
|
||||
|
||||
### http://www.w3.org/1999/02/22-rdf-syntax-ns#langString
|
||||
rdf:langString rdf:type rdfs:Datatype ;
|
||||
rdfs:label "Language-tagged string"@en .
|
||||
|
||||
|
||||
### http://www.w3.org/2001/XMLSchema#boolean
|
||||
xsd:boolean rdf:type rdfs:Datatype ;
|
||||
rdfs:label "Boolean"@en .
|
||||
|
||||
|
||||
### http://www.w3.org/2001/XMLSchema#dateTime
|
||||
xsd:dateTime rdf:type rdfs:Datatype ;
|
||||
rdfs:comment "Date and time with or without timezone"@en .
|
||||
|
||||
|
||||
### http://www.w3.org/2001/XMLSchema#decimal
|
||||
xsd:decimal rdf:type rdfs:Datatype ;
|
||||
rdfs:comment "Arbitrary-precision decimal numbers"@en ;
|
||||
rdfs:label "Decimal"@en .
|
||||
|
||||
|
||||
### http://www.w3.org/2001/XMLSchema#integer
|
||||
xsd:integer rdf:type rdfs:Datatype ;
|
||||
rdfs:comment "Arbitrary-size integer numbers"@en ;
|
||||
rdfs:label "Integer"@en .
|
||||
|
||||
|
||||
### http://www.w3.org/2001/XMLSchema#string
|
||||
xsd:string rdf:type rdfs:Datatype ;
|
||||
rdfs:label "String"@en .
|
||||
|
||||
|
||||
### http://www.w3.org/2001/XMLSchema#unsignedShort
|
||||
xsd:unsignedShort rdf:type rdfs:Datatype ;
|
||||
rdfs:label "Unsigned short"@en .
|
||||
|
||||
|
||||
#################################################################
|
||||
# Object Properties
|
||||
#################################################################
|
||||
|
||||
### http://rdaregistry.info/Elements/a/P50094
|
||||
rdaa:P50094 rdf:type owl:ObjectProperty .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/identifierForPerson.en
|
||||
rdaa:identifierForPerson.en rdf:type owl:ObjectProperty .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/m/P30154
|
||||
rdam:P30154 rdf:type owl:ObjectProperty .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/m/uniformResourceLocator.en
|
||||
rdam:uniformResourceLocator.en rdf:type owl:ObjectProperty .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/template
|
||||
:template rdf:type owl:ObjectProperty ;
|
||||
rdfs:comment "A default set of triples used during the creation of new entities of the associated class."@en ;
|
||||
rdfs:label "has template"@en .
|
||||
|
||||
|
||||
#################################################################
|
||||
# Data properties
|
||||
#################################################################
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#created
|
||||
fedora:created rdf:type owl:DatatypeProperty ;
|
||||
rdfs:subPropertyOf owl:topDataProperty .
|
||||
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#createdBy
|
||||
fedora:createdBy rdf:type owl:DatatypeProperty ;
|
||||
rdfs:subPropertyOf owl:topDataProperty .
|
||||
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#lastModified
|
||||
fedora:lastModified rdf:type owl:DatatypeProperty .
|
||||
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#lastModifiedBy
|
||||
fedora:lastModifiedBy rdf:type owl:DatatypeProperty .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/P50291
|
||||
rdaa:P50291 rdf:type owl:DatatypeProperty .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/P50292
|
||||
rdaa:P50292 rdf:type owl:DatatypeProperty .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/givenName.en
|
||||
rdaa:givenName.en rdf:type owl:DatatypeProperty .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/surname.en
|
||||
rdaa:surname.en rdf:type owl:DatatypeProperty .
|
||||
|
||||
|
||||
#################################################################
|
||||
# Classes
|
||||
#################################################################
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#Container
|
||||
fedora:Container rdf:type owl:Class ;
|
||||
rdfs:subClassOf :ReadOnly .
|
||||
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#Resource
|
||||
fedora:Resource rdf:type owl:Class ;
|
||||
rdfs:subClassOf :ReadOnly .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/c/C10001
|
||||
rdac:C10001 rdf:type owl:Class ;
|
||||
rdfs:subClassOf rdac:C10013 ;
|
||||
rdfs:label "Work"@en .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/c/C10002
|
||||
rdac:C10002 rdf:type owl:Class ;
|
||||
rdfs:subClassOf rdac:C10013 ;
|
||||
rdfs:label "Agent"@en .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/c/C10004
|
||||
rdac:C10004 rdf:type owl:Class ;
|
||||
rdfs:subClassOf rdac:C10002 ;
|
||||
rdfs:label "Person"@en .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/c/C10007
|
||||
rdac:C10007 rdf:type owl:Class ;
|
||||
rdfs:subClassOf rdac:C10013 .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/c/C10013
|
||||
rdac:C10013 rdf:type owl:Class ;
|
||||
rdfs:label "RDA Entity"@en .
|
||||
|
||||
|
||||
### http://www.w3.org/ns/ldp#BasicContainer
|
||||
ldp:BasicContainer rdf:type owl:Class ;
|
||||
rdfs:subClassOf :ReadOnly .
|
||||
|
||||
|
||||
### http://www.w3.org/ns/ldp#Container
|
||||
ldp:Container rdf:type owl:Class ;
|
||||
rdfs:subClassOf :ReadOnly .
|
||||
|
||||
|
||||
### http://www.w3.org/ns/ldp#RDFSource
|
||||
ldp:RDFSource rdf:type owl:Class ;
|
||||
rdfs:subClassOf :ReadOnly .
|
||||
|
||||
|
||||
### http://www.w3.org/ns/ldp#Resource
|
||||
ldp:Resource rdf:type owl:Class ;
|
||||
rdfs:subClassOf :ReadOnly .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/AudioBook
|
||||
:AudioBook rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "Audio Book"@en ;
|
||||
:catalogId "1"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/Book
|
||||
:Book rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "Book"@en ;
|
||||
:catalogId "2"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/Document
|
||||
:Document rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "Document"@en ;
|
||||
:catalogId "3"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/Entity
|
||||
:Entity rdf:type owl:Class ;
|
||||
rdfs:label "Graph of Liberty Entity"@en .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/Meme
|
||||
:Meme rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "Meme"@en ;
|
||||
:catalogId "4"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/Movie
|
||||
:Movie rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "Movie"@en ;
|
||||
:catalogId "5"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/Music
|
||||
:Music rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "Music"@en ;
|
||||
:catalogId "6"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/Person
|
||||
:Person rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "Person"@en ;
|
||||
:catalogId "7"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/Podcast
|
||||
:Podcast rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "Podcast"@en ;
|
||||
:catalogId "8"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/ReadOnly
|
||||
:ReadOnly rdf:type owl:Class ;
|
||||
rdfs:label "Read Only"@en .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/TVShow
|
||||
:TVShow rdf:type owl:Class ;
|
||||
rdfs:subClassOf :Entity ;
|
||||
rdfs:label "TV Show"@en ;
|
||||
:catalogId "9"^^xsd:positiveInteger .
|
||||
|
||||
|
||||
#################################################################
|
||||
# Individuals
|
||||
#################################################################
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#created
|
||||
fedora:created rdf:type owl:NamedIndividual ,
|
||||
:ReadOnly .
|
||||
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#createdBy
|
||||
fedora:createdBy rdf:type owl:NamedIndividual ,
|
||||
:ReadOnly .
|
||||
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#hasParent
|
||||
fedora:hasParent rdf:type owl:NamedIndividual ,
|
||||
:ReadOnly .
|
||||
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#lastModified
|
||||
fedora:lastModified rdf:type owl:NamedIndividual ,
|
||||
:ReadOnly .
|
||||
|
||||
|
||||
### http://fedora.info/definitions/v4/repository#lastModifiedBy
|
||||
fedora:lastModifiedBy rdf:type owl:NamedIndividual ,
|
||||
:ReadOnly .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/P50094
|
||||
rdaa:P50094 rdf:type owl:NamedIndividual ;
|
||||
owl:sameAs rdaa:identifierForPerson.en .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/identifierForPerson.en
|
||||
|
||||
### http://rdaregistry.info/Elements/a/P50291
|
||||
rdaa:P50291 rdf:type owl:NamedIndividual ;
|
||||
owl:sameAs rdaa:surname.en .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/surname.en
|
||||
|
||||
### http://rdaregistry.info/Elements/a/P50292
|
||||
rdaa:P50292 rdf:type owl:NamedIndividual ;
|
||||
owl:sameAs rdaa:givenName.en .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/givenName.en
|
||||
|
||||
### http://rdaregistry.info/Elements/a/givenName.en
|
||||
rdaa:givenName.en rdf:type owl:NamedIndividual .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/identifierForPerson.en
|
||||
rdaa:identifierForPerson.en rdf:type owl:NamedIndividual .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/a/surname.en
|
||||
rdaa:surname.en rdf:type owl:NamedIndividual .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/c/C10007
|
||||
rdac:C10007 rdf:type owl:NamedIndividual ;
|
||||
:template _:genid1 .
|
||||
|
||||
_:genid1 rdf:type rdac:C10007 ;
|
||||
rdam:uniformResourceLocator.en : .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/m/P30154
|
||||
rdam:P30154 rdf:type owl:NamedIndividual ;
|
||||
owl:sameAs rdam:uniformResourceLocator.en .
|
||||
|
||||
|
||||
### http://rdaregistry.info/Elements/m/uniformResourceLocator.en
|
||||
|
||||
### http://rdaregistry.info/Elements/m/uniformResourceLocator.en
|
||||
rdam:uniformResourceLocator.en rdf:type owl:NamedIndividual .
|
||||
|
||||
|
||||
### http://www.w3.org/ns/ldp#contains
|
||||
ldp:contains rdf:type owl:NamedIndividual ,
|
||||
:ReadOnly ;
|
||||
rdfs:label "contains"@en .
|
||||
|
||||
|
||||
### https://graphofliberty.org/2026/04/ont/
|
||||
: rdf:type owl:NamedIndividual .
|
||||
|
||||
|
||||
#################################################################
|
||||
# Annotations
|
||||
#################################################################
|
||||
|
||||
fedora:created rdfs:label "created"@en .
|
||||
|
||||
|
||||
fedora:createdBy rdfs:label "created by"@en .
|
||||
|
||||
|
||||
fedora:lastModified rdfs:label "last modified"@en .
|
||||
|
||||
|
||||
fedora:lastModifiedBy rdfs:label "last modified by"@en .
|
||||
|
||||
|
||||
rdaa:P50094 rdfs:label "has identifier for person"@en .
|
||||
|
||||
|
||||
rdaa:P50291 rdfs:label "has surname"@en ;
|
||||
:indexedByField "surname" .
|
||||
|
||||
|
||||
rdaa:P50292 rdfs:label "has given name"@en ;
|
||||
:indexedByField "given name" .
|
||||
|
||||
|
||||
rdac:C10007 rdfs:label "Manifestation"@en .
|
||||
|
||||
|
||||
rdam:P30154 rdfs:label "has uniform resource locator"@en .
|
||||
|
||||
|
||||
### Generated by the OWL API (version 4.5.29.2024-05-13T12:11:03Z) https://github.com/owlcs/owlapi
|
||||
@@ -0,0 +1,108 @@
|
||||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
||||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
||||
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
||||
@prefix dc: <http://purl.org/dc/elements/1.1/> .
|
||||
|
||||
<http://www.w3.org/2000/01/rdf-schema#> a owl:Ontology ;
|
||||
dc:title "The RDF Schema vocabulary (RDFS)" .
|
||||
|
||||
rdfs:Resource a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "Resource" ;
|
||||
rdfs:comment "The class resource, everything." .
|
||||
|
||||
rdfs:Class a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "Class" ;
|
||||
rdfs:comment "The class of classes." ;
|
||||
rdfs:subClassOf rdfs:Resource .
|
||||
|
||||
rdfs:subClassOf a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "subClassOf" ;
|
||||
rdfs:comment "The subject is a subclass of a class." ;
|
||||
rdfs:range rdfs:Class ;
|
||||
rdfs:domain rdfs:Class .
|
||||
|
||||
rdfs:subPropertyOf a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "subPropertyOf" ;
|
||||
rdfs:comment "The subject is a subproperty of a property." ;
|
||||
rdfs:range rdf:Property ;
|
||||
rdfs:domain rdf:Property .
|
||||
|
||||
rdfs:comment a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "comment" ;
|
||||
rdfs:comment "A description of the subject resource." ;
|
||||
rdfs:domain rdfs:Resource ;
|
||||
rdfs:range rdfs:Literal .
|
||||
|
||||
rdfs:label a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "label" ;
|
||||
rdfs:comment "A human-readable name for the subject." ;
|
||||
rdfs:domain rdfs:Resource ;
|
||||
rdfs:range rdfs:Literal .
|
||||
|
||||
rdfs:domain a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "domain" ;
|
||||
rdfs:comment "A domain of the subject property." ;
|
||||
rdfs:range rdfs:Class ;
|
||||
rdfs:domain rdf:Property .
|
||||
|
||||
rdfs:range a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "range" ;
|
||||
rdfs:comment "A range of the subject property." ;
|
||||
rdfs:range rdfs:Class ;
|
||||
rdfs:domain rdf:Property .
|
||||
|
||||
rdfs:seeAlso a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "seeAlso" ;
|
||||
rdfs:comment "Further information about the subject resource." ;
|
||||
rdfs:range rdfs:Resource ;
|
||||
rdfs:domain rdfs:Resource .
|
||||
|
||||
rdfs:isDefinedBy a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:subPropertyOf rdfs:seeAlso ;
|
||||
rdfs:label "isDefinedBy" ;
|
||||
rdfs:comment "The definition of the subject resource." ;
|
||||
rdfs:range rdfs:Resource ;
|
||||
rdfs:domain rdfs:Resource .
|
||||
|
||||
rdfs:Literal a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "Literal" ;
|
||||
rdfs:comment "The class of literal values, eg. textual strings and integers." ;
|
||||
rdfs:subClassOf rdfs:Resource .
|
||||
|
||||
rdfs:Container a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "Container" ;
|
||||
rdfs:subClassOf rdfs:Resource ;
|
||||
rdfs:comment "The class of RDF containers." .
|
||||
|
||||
rdfs:ContainerMembershipProperty a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "ContainerMembershipProperty" ;
|
||||
rdfs:comment """The class of container membership properties, rdf:_1, rdf:_2, ..., all of which are sub-properties of 'member'.""" ;
|
||||
rdfs:subClassOf rdf:Property .
|
||||
|
||||
rdfs:member a rdf:Property ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "member" ;
|
||||
rdfs:comment "A member of the subject resource." ;
|
||||
rdfs:domain rdfs:Resource ;
|
||||
rdfs:range rdfs:Resource .
|
||||
|
||||
rdfs:Datatype a rdfs:Class ;
|
||||
rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;
|
||||
rdfs:label "Datatype" ;
|
||||
rdfs:comment "The class of RDF datatypes." ;
|
||||
rdfs:subClassOf rdfs:Class .
|
||||
|
||||
<http://www.w3.org/2000/01/rdf-schema#> rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .
|
||||
@@ -0,0 +1,411 @@
|
||||
use crate::error;
|
||||
use oxigraph::io::{RdfFormat, RdfParser};
|
||||
use oxigraph::model::vocab::{rdf, rdfs, xsd};
|
||||
use oxigraph::model::{
|
||||
Dataset, NamedNode, NamedNodeRef, NamedOrBlankNode, NamedOrBlankNodeRef, Term, TermRef, Triple,
|
||||
TripleRef,
|
||||
};
|
||||
use oxigraph::sparql::{QueryResults, SparqlEvaluator};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
const PREFIXES: &[(&str, &str)] = &[
|
||||
("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"),
|
||||
("rdfs", "http://www.w3.org/2000/01/rdf-schema#"),
|
||||
("owl", "http://www.w3.org/2002/07/owl#"),
|
||||
("xsd", "http://www.w3.org/2001/XMLSchema#"),
|
||||
("ldp", "http://www.w3.org/ns/ldp#"),
|
||||
("dc", "http://purl.org/dc/elements/1.1/"),
|
||||
("posix", "http://www.w3.org/ns/posix/stat#"),
|
||||
(
|
||||
"ebucore",
|
||||
"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#",
|
||||
),
|
||||
("premis", "http://www.loc.gov/premis/rdf/v1#"),
|
||||
("premis3", "http://www.loc.gov/premis/rdf/v3/"),
|
||||
("dcterms", "http://purl.org/dc/terms/"),
|
||||
("fedora", "http://fedora.info/definitions/v4/repository#"),
|
||||
("rdaa", "http://rdaregistry.info/Elements/a/"),
|
||||
("rdac", "http://rdaregistry.info/Elements/c/"),
|
||||
("rdae", "http://rdaregistry.info/Elements/e/"),
|
||||
("rdai", "http://rdaregistry.info/Elements/i/"),
|
||||
("rdam", "http://rdaregistry.info/Elements/m/"),
|
||||
("rdan", "http://rdaregistry.info/Elements/n/"),
|
||||
("rdap", "http://rdaregistry.info/Elements/p/"),
|
||||
("rdat", "http://rdaregistry.info/Elements/t/"),
|
||||
("rdaw", "http://rdaregistry.info/Elements/w/"),
|
||||
("rdax", "http://rdaregistry.info/Elements/x/"),
|
||||
("schema", "https://schema.org/"),
|
||||
("quill", "http://fedora.quill.lan/rest/"),
|
||||
("gl", "https://graphofliberty.org/2026/04/ont/"),
|
||||
];
|
||||
|
||||
const RDF_ONT: &[u8] = include_bytes!("ontologies/22-rdf-syntax-ns.ttl");
|
||||
const RDFS_ONT: &[u8] = include_bytes!("ontologies/rdf-schema.ttl");
|
||||
const LDP_ONT: &[u8] = include_bytes!("ontologies/ldp.ttl");
|
||||
const FEDORA_ONT: &[u8] = include_bytes!("ontologies/fedora.xml");
|
||||
const GL_ONT: &[u8] = include_bytes!("ontologies/ontology.ttl");
|
||||
|
||||
const GL_READ_ONLY: NamedNodeRef =
|
||||
NamedNodeRef::new_unchecked("https://graphofliberty.org/2026/04/ont/ReadOnly");
|
||||
const GL_TEMPLATE: NamedNodeRef =
|
||||
NamedNodeRef::new_unchecked("https://graphofliberty.org/2026/04/ont/template");
|
||||
const GL_INDEXED_BY_FIELD: NamedNodeRef =
|
||||
NamedNodeRef::new_unchecked("https://graphofliberty.org/2026/04/ont/indexedByField");
|
||||
const GL_CATALOG_ID: NamedNodeRef =
|
||||
NamedNodeRef::new_unchecked("https://graphofliberty.org/2026/04/ont/catalogId");
|
||||
const OWL_SAME_AS: NamedNodeRef =
|
||||
NamedNodeRef::new_unchecked("http://www.w3.org/2002/07/owl#sameAs");
|
||||
|
||||
pub const RDA_ENTITY: NamedNodeRef =
|
||||
NamedNodeRef::new_unchecked("http://rdaregistry.info/Elements/c/C10013");
|
||||
pub const GL_ENTITY: NamedNodeRef =
|
||||
NamedNodeRef::new_unchecked("https://graphofliberty.org/2026/04/ont/Entity");
|
||||
|
||||
pub struct OntologyBuilder<'a> {
|
||||
ontologies: Vec<(RdfFormat, &'a [u8])>,
|
||||
}
|
||||
|
||||
impl<'a> OntologyBuilder<'a> {
|
||||
pub fn with_ontology_bytes(mut self, format: RdfFormat, bytes: &'a [u8]) -> Self {
|
||||
self.ontologies.push((format, bytes));
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_default_ontologies(self) -> Self {
|
||||
self.with_ontology_bytes(RdfFormat::Turtle, RDF_ONT)
|
||||
.with_ontology_bytes(RdfFormat::Turtle, RDFS_ONT)
|
||||
.with_ontology_bytes(RdfFormat::Turtle, LDP_ONT)
|
||||
.with_ontology_bytes(RdfFormat::RdfXml, FEDORA_ONT)
|
||||
.with_ontology_bytes(RdfFormat::Turtle, GL_ONT)
|
||||
}
|
||||
|
||||
fn materialize_same_as(dataset: &mut Dataset) {
|
||||
let additional_quads = dataset
|
||||
.quads_for_pattern(None, Some(OWL_SAME_AS), None, None)
|
||||
.fold(Dataset::new(), |mut new_dataset, alias| {
|
||||
if let NamedOrBlankNodeRef::NamedNode(x) = alias.subject
|
||||
&& let TermRef::NamedNode(y) = alias.object
|
||||
{
|
||||
for mut quad in dataset.quads_for_pattern(
|
||||
Some(NamedOrBlankNodeRef::NamedNode(x)),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
) {
|
||||
quad.subject = NamedOrBlankNodeRef::NamedNode(y);
|
||||
new_dataset.insert(quad);
|
||||
}
|
||||
|
||||
for mut quad in dataset.quads_for_pattern(
|
||||
Some(NamedOrBlankNodeRef::NamedNode(y)),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
) {
|
||||
quad.subject = NamedOrBlankNodeRef::NamedNode(x);
|
||||
new_dataset.insert(quad);
|
||||
}
|
||||
}
|
||||
new_dataset
|
||||
});
|
||||
|
||||
let old_size = dataset.len();
|
||||
dataset.extend(&additional_quads);
|
||||
let new_size = dataset.len();
|
||||
|
||||
if new_size > old_size {
|
||||
Self::materialize_same_as(dataset)
|
||||
}
|
||||
}
|
||||
|
||||
fn memoize(ontology: &mut Ontology) {
|
||||
// Read-only properties
|
||||
for quad in ontology.dataset.quads_for_pattern(
|
||||
None,
|
||||
Some(rdf::TYPE),
|
||||
Some(TermRef::NamedNode(GL_READ_ONLY)),
|
||||
None,
|
||||
) {
|
||||
if let NamedOrBlankNodeRef::NamedNode(subject) = quad.subject {
|
||||
ontology.read_only_properties.insert(subject.into_owned());
|
||||
}
|
||||
}
|
||||
|
||||
// Read-only classes
|
||||
for quad in ontology.dataset.quads_for_pattern(
|
||||
None,
|
||||
Some(rdfs::SUB_CLASS_OF),
|
||||
Some(TermRef::NamedNode(GL_READ_ONLY)),
|
||||
None,
|
||||
) {
|
||||
if let NamedOrBlankNodeRef::NamedNode(subject) = quad.subject {
|
||||
ontology.read_only_classes.insert(subject.into_owned());
|
||||
}
|
||||
}
|
||||
|
||||
// Full-text search index field names
|
||||
for quad in ontology
|
||||
.dataset
|
||||
.quads_for_pattern(None, Some(GL_INDEXED_BY_FIELD), None, None)
|
||||
{
|
||||
if let NamedOrBlankNodeRef::NamedNode(subject) = quad.subject
|
||||
&& let TermRef::Literal(literal) = quad.object
|
||||
{
|
||||
ontology
|
||||
.field_map
|
||||
.insert(subject.into_owned(), literal.value().to_string());
|
||||
}
|
||||
}
|
||||
|
||||
// Catalog IDs (used to quickly filter full-text search results)
|
||||
for quad in ontology
|
||||
.dataset
|
||||
.quads_for_pattern(None, Some(GL_CATALOG_ID), None, None)
|
||||
{
|
||||
if let NamedOrBlankNodeRef::NamedNode(subject) = quad.subject
|
||||
&& let TermRef::Literal(literal) = quad.object
|
||||
{
|
||||
if literal.datatype() == xsd::POSITIVE_INTEGER {
|
||||
let value: u64 = literal.value().parse().expect("Failed to parse catalog ID from ontology. It ought to be a positive integer.");
|
||||
ontology.catalog_ids.insert(subject.into_owned(), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build(&mut self) -> error::Result<Ontology> {
|
||||
let prefixes = PREFIXES
|
||||
.iter()
|
||||
.map(|(k, v)| (k.to_string(), v.to_string()))
|
||||
.collect::<HashMap<String, String>>();
|
||||
|
||||
let mut dataset = Dataset::new();
|
||||
for (format, bytes) in &self.ontologies {
|
||||
let quads = RdfParser::from_format(*format)
|
||||
.for_slice(bytes)
|
||||
.filter_map(Result::ok);
|
||||
dataset.extend(quads);
|
||||
}
|
||||
Self::materialize_same_as(&mut dataset);
|
||||
|
||||
let mut ontology = Ontology {
|
||||
dataset,
|
||||
prefixes,
|
||||
read_only_properties: HashSet::new(),
|
||||
read_only_classes: HashSet::new(),
|
||||
field_map: HashMap::new(),
|
||||
catalog_ids: HashMap::new(),
|
||||
};
|
||||
|
||||
Self::memoize(&mut ontology);
|
||||
Ok(ontology)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Ontology {
|
||||
dataset: Dataset,
|
||||
prefixes: HashMap<String, String>,
|
||||
read_only_properties: HashSet<NamedNode>,
|
||||
read_only_classes: HashSet<NamedNode>,
|
||||
field_map: HashMap<NamedNode, String>,
|
||||
catalog_ids: HashMap<NamedNode, u64>,
|
||||
}
|
||||
|
||||
fn term_to_string(term: &Term) -> Option<String> {
|
||||
match term {
|
||||
Term::Literal(literal) => Some(literal.value().to_string()),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
impl Ontology {
|
||||
pub fn builder<'a>() -> OntologyBuilder<'a> {
|
||||
OntologyBuilder {
|
||||
ontologies: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn label<'a>(&'a self, node: NamedNodeRef<'a>) -> Option<&'a str> {
|
||||
let quads = self.dataset.quads_for_pattern(
|
||||
Some(NamedOrBlankNodeRef::NamedNode(node)),
|
||||
Some(rdfs::LABEL),
|
||||
None,
|
||||
None,
|
||||
);
|
||||
for quad in quads {
|
||||
if let TermRef::Literal(literal) = quad.object {
|
||||
match literal.language() {
|
||||
None | Some("en") => return Some(literal.value()),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
pub fn abbreviate(&self, node: NamedNodeRef<'_>) -> String {
|
||||
for (prefix_name, prefix_iri) in &self.prefixes {
|
||||
if let Some(local_name) = node.as_str().strip_prefix(prefix_iri) {
|
||||
return if local_name.is_empty() {
|
||||
format!("{prefix_name}:")
|
||||
} else {
|
||||
format!("{prefix_name}:{local_name}")
|
||||
};
|
||||
}
|
||||
}
|
||||
node.as_str().to_string()
|
||||
}
|
||||
|
||||
pub fn expand(&self, prefixed_iri: &str) -> Option<NamedNode> {
|
||||
let (prefix, name) = prefixed_iri.split_once(':')?;
|
||||
self.prefixes
|
||||
.get(prefix)
|
||||
.map(|base| NamedNode::new_unchecked(format!("{base}{name}")))
|
||||
}
|
||||
|
||||
pub fn field_name(&self, property: &NamedNode) -> Option<&String> {
|
||||
self.field_map.get(property)
|
||||
}
|
||||
|
||||
pub fn catalog_id(&self, class: &NamedNode) -> Option<u64> {
|
||||
self.catalog_ids.get(class).copied()
|
||||
}
|
||||
|
||||
pub fn for_each_annotated_iri<F>(&self, f: F)
|
||||
where
|
||||
F: Fn(&str, Option<&str>, Option<&str>),
|
||||
{
|
||||
let query = SparqlEvaluator::new()
|
||||
.parse_query(
|
||||
r"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
|
||||
SELECT ?subject ?label ?comment WHERE {
|
||||
OPTIONAL {
|
||||
?subject rdfs:label ?label .
|
||||
FILTER (LANG(?label) = 'en' || LANG(?label) = '')
|
||||
}
|
||||
OPTIONAL {
|
||||
?subject rdfs:comment ?comment .
|
||||
FILTER (LANG(?comment) = 'en' || LANG(?comment) = '')
|
||||
}
|
||||
}",
|
||||
)
|
||||
.expect("Unable to parse annotation query");
|
||||
|
||||
if let QueryResults::Solutions(solutions) =
|
||||
query.on_queryable_dataset(&self.dataset).execute().unwrap()
|
||||
{
|
||||
for solution in solutions.filter_map(Result::ok) {
|
||||
let label = solution.get("label").and_then(term_to_string);
|
||||
let comment = solution.get("comment").and_then(term_to_string);
|
||||
if let Some(Term::NamedNode(subject)) = solution.get("subject") {
|
||||
f(subject.as_str(), label.as_deref(), comment.as_deref());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn datatypes(&self) -> impl Iterator<Item = NamedNodeRef<'_>> {
|
||||
self.dataset
|
||||
.quads_for_pattern(
|
||||
None,
|
||||
Some(rdf::TYPE),
|
||||
Some(TermRef::NamedNode(rdfs::DATATYPE)),
|
||||
None,
|
||||
)
|
||||
.filter_map(|quad| match quad.subject {
|
||||
NamedOrBlankNodeRef::NamedNode(subject) => Some(subject),
|
||||
_ => None,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn is_read_only<'a>(&self, triple: impl Into<TripleRef<'a>>) -> bool {
|
||||
let triple = triple.into();
|
||||
let read_only_property = self
|
||||
.read_only_properties
|
||||
.contains(&triple.predicate.into_owned());
|
||||
let read_only_class = match (triple.predicate, triple.object) {
|
||||
(rdf::TYPE, TermRef::NamedNode(node)) => {
|
||||
self.read_only_classes.contains(&node.into_owned())
|
||||
}
|
||||
_ => false,
|
||||
};
|
||||
read_only_property || read_only_class
|
||||
}
|
||||
|
||||
pub fn exclude_read_only_predicate(&self) -> impl Fn(TripleRef<'_>) -> bool + 'static {
|
||||
let classes = self.read_only_classes.clone();
|
||||
let properties = self.read_only_properties.clone();
|
||||
move |triple| {
|
||||
let read_only_property = properties.contains(&triple.predicate.into_owned());
|
||||
let read_only_class = match (triple.predicate, triple.object) {
|
||||
(rdf::TYPE, TermRef::NamedNode(node)) => classes.contains(&node.into_owned()),
|
||||
_ => false,
|
||||
};
|
||||
!(read_only_property || read_only_class)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn subclass_of(&self, class: NamedNodeRef<'_>) -> impl Iterator<Item = NamedNode> {
|
||||
let query = SparqlEvaluator::new()
|
||||
.parse_query(
|
||||
format!(
|
||||
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||
SELECT ?class {{
|
||||
?class (rdfs:subClassOf|^rdfs:subClassOf)* {class} .
|
||||
}}"
|
||||
)
|
||||
.as_str(),
|
||||
)
|
||||
.expect("Unable to parse subclass_of query");
|
||||
|
||||
if let QueryResults::Solutions(solutions) =
|
||||
query.on_queryable_dataset(&self.dataset).execute().unwrap()
|
||||
{
|
||||
solutions.filter_map(Result::ok).filter_map(|solution| {
|
||||
if let Some(Term::NamedNode(class)) = solution.get("class") {
|
||||
Some(class.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn template_triples<'a>(
|
||||
&'a self,
|
||||
class: NamedNodeRef<'a>,
|
||||
subject: NamedNodeRef<'_>,
|
||||
) -> Option<impl Iterator<Item = Triple>> {
|
||||
if let Some(quad) = self
|
||||
.dataset
|
||||
.quads_for_pattern(
|
||||
Some(NamedOrBlankNodeRef::NamedNode(class)),
|
||||
Some(GL_TEMPLATE),
|
||||
None,
|
||||
None,
|
||||
)
|
||||
.next()
|
||||
{
|
||||
if let TermRef::BlankNode(blank_node) = quad.object {
|
||||
let iter = self
|
||||
.dataset
|
||||
.quads_for_subject(blank_node)
|
||||
.map(|quad| quad.into_owned())
|
||||
.map(Triple::from)
|
||||
.map(move |mut triple| {
|
||||
triple.subject = NamedOrBlankNode::NamedNode(subject.into_owned());
|
||||
triple
|
||||
});
|
||||
Some(iter)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
use oxigraph::model::vocab::{rdf, xsd};
|
||||
use oxigraph::model::{BaseDirection, Literal, NamedNode, NamedNodeRef, Term, TermRef};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TermHelper<'a> {
|
||||
term: &'a Term,
|
||||
}
|
||||
|
||||
impl<'a> TermHelper<'a> {
|
||||
pub fn new(term: &'a Term) -> Self {
|
||||
TermHelper { term }
|
||||
}
|
||||
|
||||
pub fn value(&self) -> &str {
|
||||
match self.term.as_ref() {
|
||||
TermRef::Literal(literal) => literal.value(),
|
||||
TermRef::NamedNode(node) => node.as_str(),
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn value_as_named_node(&self) -> Option<NamedNodeRef<'a>> {
|
||||
match self.term.as_ref() {
|
||||
TermRef::NamedNode(node) => Some(node),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn language(&self) -> Option<&str> {
|
||||
if let TermRef::Literal(literal) = self.term.as_ref() {
|
||||
literal.language()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn direction(&self) -> Option<BaseDirection> {
|
||||
if let TermRef::Literal(literal) = self.term.as_ref() {
|
||||
literal.direction()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn datatype(&self) -> Option<NamedNodeRef<'_>> {
|
||||
if let TermRef::Literal(literal) = self.term.as_ref() {
|
||||
Some(literal.datatype())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_named_node(&self) -> bool {
|
||||
self.term.is_named_node()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct TermHelperMut<'a> {
|
||||
term: &'a mut Term,
|
||||
}
|
||||
|
||||
impl<'a> TermHelperMut<'a> {
|
||||
pub fn new(term: &'a mut Term) -> Self {
|
||||
TermHelperMut { term }
|
||||
}
|
||||
|
||||
pub fn set_datatype(&mut self, datatype: Option<NamedNode>) {
|
||||
let value = match self.term.as_ref() {
|
||||
TermRef::Literal(literal) => literal.value(),
|
||||
TermRef::NamedNode(node) => node.as_str(),
|
||||
_ => unimplemented!(),
|
||||
};
|
||||
|
||||
if let Some(datatype) = datatype {
|
||||
let language = if let TermRef::Literal(literal) = self.term.as_ref() {
|
||||
literal.language()
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let direction = if let TermRef::Literal(literal) = self.term.as_ref() {
|
||||
literal.direction().unwrap_or(BaseDirection::Ltr)
|
||||
} else {
|
||||
BaseDirection::Ltr
|
||||
};
|
||||
|
||||
let language = language.unwrap_or("en");
|
||||
let literal = match datatype.as_ref() {
|
||||
rdf::LANG_STRING => Literal::new_language_tagged_literal_unchecked(value, language),
|
||||
rdf::DIR_LANG_STRING => Literal::new_directional_language_tagged_literal_unchecked(
|
||||
value, language, direction,
|
||||
),
|
||||
xsd::STRING => Literal::new_simple_literal(value),
|
||||
_ => Literal::new_typed_literal(value, datatype),
|
||||
};
|
||||
*self.term = Term::Literal(literal);
|
||||
} else {
|
||||
*self.term = Term::NamedNode(NamedNode::new_unchecked(value))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_language(&mut self, language: &str) {
|
||||
if let TermRef::Literal(literal) = self.term.as_ref() {
|
||||
let value = literal.value();
|
||||
let datatype = literal.datatype();
|
||||
let base_direction = literal.direction();
|
||||
let new_literal = match (datatype, base_direction) {
|
||||
(rdf::LANG_STRING, _) => {
|
||||
Literal::new_language_tagged_literal_unchecked(value, language)
|
||||
}
|
||||
(rdf::DIR_LANG_STRING, Some(base_direction)) => {
|
||||
Literal::new_directional_language_tagged_literal_unchecked(
|
||||
value,
|
||||
language,
|
||||
base_direction,
|
||||
)
|
||||
}
|
||||
(xsd::STRING, _) => Literal::new_simple_literal(value),
|
||||
_ => Literal::new_typed_literal(value, datatype),
|
||||
};
|
||||
*self.term = Term::Literal(new_literal)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_direction(&mut self, direction: BaseDirection) {
|
||||
let value = match self.term.as_ref() {
|
||||
TermRef::Literal(literal) => literal.value(),
|
||||
TermRef::NamedNode(node) => node.as_str(),
|
||||
_ => unimplemented!(),
|
||||
};
|
||||
|
||||
if let TermRef::Literal(literal) = self.term.as_ref() {
|
||||
let language = literal.language().unwrap_or("en");
|
||||
let new_literal = Literal::new_directional_language_tagged_literal_unchecked(
|
||||
value, language, direction,
|
||||
);
|
||||
*self.term = Term::Literal(new_literal);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_value(&mut self, value: String) {
|
||||
match self.term.as_ref() {
|
||||
TermRef::Literal(literal) => {
|
||||
let datatype = literal.datatype();
|
||||
let language = literal.language();
|
||||
let base_direction = literal.direction();
|
||||
let new_literal = match (datatype, language, base_direction) {
|
||||
(rdf::LANG_STRING, Some(language), _) => {
|
||||
Literal::new_language_tagged_literal_unchecked(value, language)
|
||||
}
|
||||
(rdf::DIR_LANG_STRING, Some(language), Some(base_direction)) => {
|
||||
Literal::new_directional_language_tagged_literal_unchecked(
|
||||
value,
|
||||
language,
|
||||
base_direction,
|
||||
)
|
||||
}
|
||||
(xsd::STRING, _, _) => Literal::new_simple_literal(value),
|
||||
_ => Literal::new_typed_literal(value, datatype),
|
||||
};
|
||||
*self.term = Term::Literal(new_literal)
|
||||
}
|
||||
TermRef::NamedNode(_) => *self.term = Term::NamedNode(NamedNode::new_unchecked(value)),
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user