Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I created below ontology using protege and imported exactly into GraphDB.
I've 1 individual "HxH" which is of type "comic" and has country "Japan". I've defined "Manga" as owl:equivalentClass to "comic + Japan".
When I run reasoner
in protege it is able to infer that HxH is of type Manga
. GraphDB doesn't infer this. It only display explicit triples both in query result and graph overview tab.
Image from Protege :
Protege is able to infer that HxH is of type Manga (yellow highlights)
Sparql query (in graphDB) :
PREFIX : <http://www.comic.org/o-1#>
select * where {
:HxH?p ?o .
} limit 100
Result of above query :
GraphDB couldn't infer HxH is of type Manga.
Ontology I created (Turtle syntax) :
@prefix : <http://www.comic.org/o-1#> .
@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 rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://www.comic.org/o-1> .
<http://www.comic.org/o-1> rdf:type owl:Ontology .
#################################################################
# Object Properties
#################################################################
### http://www.comic.org/o-1#hasCountryOfOrigin
:hasCountryOfOrigin rdf:type owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain :Comic ;
rdfs:range :Country .
#################################################################
# Classes
#################################################################
### http://www.comic.org/o-1#Comic
:Comic rdf:type owl:Class ;
owl:disjointWith :Country .
### http://www.comic.org/o-1#Country
:Country rdf:type owl:Class .
### http://www.comic.org/o-1#Manga
:Manga rdf:type owl:Class ;
owl:equivalentClass [ owl:intersectionOf ( :Comic
[ rdf:type owl:Restriction ;
owl:onProperty :hasCountryOfOrigin ;
owl:hasValue :Japan
rdf:type owl:Class
#################################################################
# Individuals
#################################################################
### http://www.comic.org/o-1#HxH
:HxH rdf:type owl:NamedIndividual ,
:Comic ;
:hasCountryOfOrigin :Japan .
### http://www.comic.org/o-1#Japan
:Japan rdf:type owl:NamedIndividual ,
:Country .
### Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi
–
–
–
the problem was when we create a new DB instance in GraphDB it set "Ruleset = RDF-Plus" by default.
Changing this to "OWL-Max" or any other rule set that support equivalence, intersection and hasValue should do the job.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.