0

If I want to infer that "Obama bornIn USA" from these facts:

 Obama bornIn Hawaii 
 Hawaii partOf USA

Are these two facts sufficient to make the inference? If yes, should RDFS or OWL be used to represent the facts? Is there some online SPARQL tool that I can quickly test those facts specification and inference based on the facts?

user697911
  • 10,043
  • 25
  • 95
  • 169
  • 1
    `partOf` is **not** part of neither RDFS nor OWL semantics, thus, no - no RDFS or OWL reasoner would make this inference. – UninformedUser Dec 29 '17 at 00:25
  • Online SPARQL tools? No, you can use your own triple store, either use Protege ontology editor which has some SPARQL plugin, or some other in-memory SPARQL engine like Apache Jena, RDF4J etc. Or some disk-based triples store ... – UninformedUser Dec 29 '17 at 00:27
  • @AKSW, so how to make this inference possible? This seems like a very common or logical reasoning. If ISA is just one type of inference. The inference demonstrated in this example seems more common. Isn't there a way to achieve this? – user697911 Dec 29 '17 at 00:39
  • Or in another way to put it, when talking about inference in ontology, is the ISA the only relation that can be inferred? – user697911 Dec 29 '17 at 00:41
  • 1
    Anything beyond built-in inference relations like `rdf:type` (what you called "is-a"), `rdfs:subClassOf`, etc. has to be modelled by yourself of course. In your case either use a rule language like SWRL or an OWL property chain axiom. Clearly, you should read about the semantics of RDFS and OWL to understand how the reasoning works. For RDFS there is a set of inference rules, for OWL you have to understand the set-based semantics of the underlying Description Logic SROIQ. – UninformedUser Dec 29 '17 at 07:12
  • That's cool to know: Property chain or SWRL. – user697911 Dec 30 '17 at 00:12

1 Answers1

4

Nobody knows what is bornIn or partOf. You should find an appropriate ontology or model this stuff yourself. There are several ways to do it.

OWL 2 capabilities

OWL 2 DL capabilities are sufficient to make the inference you want.
All you need is a property chain.

Here below a sample ontology serialized into the RDF Turtle format.

@prefix : <http://www.semanticweb.org/ontologies/ontology#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

<http://www.semanticweb.org/ontologies/ontology> rdf:type owl:Ontology .

:Obama    rdf:type owl:NamedIndividual ; :bornIn :Honolulu .
:Honolulu rdf:type owl:NamedIndividual ; :partOf :Hawaii .
:Hawaii   rdf:type owl:NamedIndividual ; :partOf :USA .
:USA      rdf:type owl:NamedIndividual .

:bornIn rdf:type owl:ObjectProperty ; owl:propertyChainAxiom ( :bornIn :partOf ) .

:partOf rdf:type owl:ObjectProperty .

Common rule languages

You could replace the property chain axiom with the following SWRL rule.

bornIn(?person, ?place1) ^ partOf(?place1, ?place2) -> bornIn(?person, ?place2)

SWRL operates on ontological level. Other more or less common rule languages (e.g. SPIN) operate on RDF serialization level.

Triplestore-specific rule languages

In GraphDB, you could define a "ruleset" of this kind:

Prefices { obama: http://www.semanticweb.org/ontologies/ontology# }

Axioms { }

Rules
{
    Id: custom
      a <obama:bornIn> b
      b <obama:partOf> c
    -----------------------
      a <obama:bornIn> c
}

Is there some online SPARQL tool that I can quickly test those facts specification and inference based on the facts?

Questions asking to recommend or find a tool or other off-site resource are off-topic for SO. However, the table below compares some popular tools.

+---------+-----+------+-----+-------+
|         | OWL | SWRL |  …  | rules |
+---------+-----+------+-----+-------+
| Protege |  +  |  +   |  …  |   –   |
| Stardog |  +  |  +   |  …  |   +   |
| GraphDB |  ±  |  –   |  …  |   +   |
|    …    |  …  |  …   |  …  |   …   |
+---------+-----+------+-----+-------+

I'd suggest you try GraphDB Cloud. When creating a repository:

  • load the ruleset above, if you want to use GraphDB's rule language, or
  • select the built-in OWL-RL ruleset, if you want to use OWL 2 capabilities.
Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
  • It's great example, very clear! Also, compared to StarDog, what benefits dose GraphDB enjoys, if I have to choose between the two? – user697911 Dec 29 '17 at 22:09
  • I'm not very familiar with Stardog. If you need full OWL 2 support, then Stardog should be your choice. However, it is not very easy to run it on Windows, and there is no free cloud version (AFAIK). Test both. BTW, it seems you don't need transitivity of `:partOf`, I'll edit the answer tomorrow. – Stanislav Kralin Dec 29 '17 at 22:52