Warning:
This wiki has been archived and is now read-only.

Partial Import

From RDF Data Shapes Working Group
Jump to: navigation, search

When an ontology is imported it is often the case that many concepts and properties will be irrelevant to the needs at hand. In addition transitive imports can lead to increased "Ontology Glut". In controlled environments, applications may also want to use different constraints than those defined by the ontologies at their authoritative source.

A well-established practice is to not do owl:imports but to explicitly re-declare the triples needed for the given scenario in a separate named graph. Another approach is to redirect imports, so that when an owl:import is found, it will not go the default source on the web, but to a local copy that may have been manipulated for the local scope.

Example: Default Shape/Ontology

The following class definitions informs a form builder that a Person may have given name and/or first name. Some data may be published using one or the other.

   foaf:Person
       a rdfs:Class .
   foaf:givenName
       rdfs:domain foaf:Person .
   foaf:firstName
       rdfs:domain foaf:Person .

An example instance:

   ex:MyPerson
       a foaf:Person ;
       foaf:givenName "John" .

Example: Local copy

A local application would use that graph instead, whenever someone refers to the foaf namespace. The graph may also have a totally different URI, which is imported instead. This tells the form builder that only foaf:givenName is relevant, and also adds dc:identifier to the required properties.

   foaf:Person
       a rdfs:Class .
       ldom:property [
           ldom:predicate foaf:givenName ;
           ldom:minCount 1 ;
           ldom:valueType xsd:string ;
       ] ;
       ldom:property [
           ldom:predicate dc:identifier ;
           ldom:minCount 1 ;
           ldom:maxCount 1 ;
           ldom:valueType xsd:string ;
       ] .

Related Approaches

The approach above can be generalized into a Context architecture, where applications can select which constraints they want to use, and which they want to ignore. See https://lists.w3.org/Archives/Public/public-data-shapes-wg/2015Jan/0198.html