r2 - 2019-09-09 - 15:26:15 - Main.ndjcYou are here: TWiki >  LinkedData Web > BestPractices > BeCarefulWithUseOfInferencingInVocabularies
This wiki: The development wiki is a work area where Jazz development teams plan and discuss technical designs and operations for the projects at Jazz.net. Work items often link to documents here. You are welcome to browse, follow along, and participate. Participation is what Jazz.net is all about! But please keep in mind that information here is "as is", unsupported, and may be outdated or inaccurate. For information on released products, consult IBM Knowledge Center, support tech notes, and the Jazz.net library. See also the Jazz.net Terms of Use.

Any documentation or reference material found in this wiki is not official product documentation, but it is primarily for the use of the development teams. For your end use, you should consult official product documentation (infocenters), IBM.com support artifacts (tech notes), and the jazz.net library as officially "stamped" resources.

Best Practice: Be careful with the use of inferencing in RDF Vocabularies

State: Draft

Contact: Nick Crossley


This Best Practice discusses inappropriate usage of inferencing properties such as rdfs:domain and rdfs:range in RDF vocabularies.


RDFS contains terms such as rdfs:domain and rdfs:range, which go beyond mere vocabulary definition and enter into the world of ontologies. The primary difference between a vocabulary and an ontology is that an ontology includes inference rules which let you infer new information from given information - that is, add new triples to those stated, rather than constrain data to some schema.

For more information on this, read OSLC Resource Shape - A language for defining constraints on Linked Data.

In the light of this knowledge, be careful with the use of inferencing terms in vocabularies - they often do not mean what you might have thought they meant. In particular, do not use rdfs:domain or rdfs:range with multiple values when defining a vocabulary term for a property, since that infers the target of that property is of all mentioned types, not any one of them.


Here is an example snippet of an RDF vocabulary document:

@prefix oslc:         <http://open-services.net/ns/core#> .
@prefix oslc_qm:      <http://open-services.net/ns/qm#> .
@prefix oslc_rm:      <http://open-services.net/ns/rm#> .
@prefix rdfs:         <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:          <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

  a rdf:Property ;
  rdfs:isDefinedBy    oslc_qm: ;
  rdfs:label          "validatesRequirement" ;
  rdfs:comment        "Requirement that is validated by the Test Case." ;
  rdfs:range          oslc_rm:Requirement ;
  rdfs:domain         oslc_qm:TestScript, oslc_qm:TestCase ;
  oslc:inverseLabel   "Validated By" .

This states that the target of an oslc_qm:validatesRequirement property is both an oslc_qm:TestScript and an oslc_qm:TestCase - which is not what the author intended. It also implies that any resource using this property may be inferred to be an OSLC requirement - which could prevent reuse of this property for requirements from non-OSLC providers.

In this case, the vocabulary term would be better defined without the use of rdfs:range and rdfs:domain.

The shape for resources using this property should consider use of the oslc:range property to suggest likely target types for the values of the property.

See Also

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
This site is powered by the TWiki collaboration platformCopyright © by IBM and non-IBM contributing authors. All material on this collaboration platform is the property of the contributing authors.
Contributions are governed by our Terms of Use
Ideas, requests, problems regarding TWiki? Send feedback
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.