1

With the following RDF in Blazegraph (taken from this answer):

:eats rdf:type owl:ObjectProperty .

:Vegetable rdf:type owl:Class ;
       rdfs:subClassOf owl:Thing .

:Vegetarian rdf:type owl:Class ;
        owl:equivalentClass [ rdf:type owl:Restriction ;
                              owl:onProperty :eats ;
                              owl:someValuesFrom :Vegetable
                            ] .

:Carrot rdf:type :Vegetable ,
             owl:NamedIndividual .

:John rdf:type owl:NamedIndividual , owl:Thing ;
      :eats :carrot .

the following SPARQL is returning blank:

select ?who
where 
{
  ?who a :Vegetarian .       
}

Here are the Blazegraph namespace configs (Blazegraph is running as NanoSparqlServer from command line):

com.bigdata.namespace.kb.spo.com.bigdata.btree.BTree.branchingFactor    1024
com.bigdata.relation.container  test-ng-2
com.bigdata.journal.AbstractJournal.bufferMode  DiskRW
com.bigdata.journal.AbstractJournal.file    bigdata.jnl
com.bigdata.journal.AbstractJournal.initialExtent   209715200
com.bigdata.rdf.store.AbstractTripleStore.vocabularyClass   com.bigdata.rdf.vocab.DefaultBigdataVocabulary
com.bigdata.rdf.store.AbstractTripleStore.textIndex false
com.bigdata.btree.BTree.branchingFactor 128
com.bigdata.namespace.kb.lex.com.bigdata.btree.BTree.branchingFactor    400
com.bigdata.rdf.store.AbstractTripleStore.axiomsClass   com.bigdata.rdf.axioms.OwlAxioms
com.bigdata.service.AbstractTransactionService.minReleaseAge    1
com.bigdata.rdf.sail.truthMaintenance   true
com.bigdata.journal.AbstractJournal.maximumExtent   209715200
com.bigdata.rdf.sail.namespace  test-ng-2
com.bigdata.relation.class  com.bigdata.rdf.store.LocalTripleStore
com.bigdata.rdf.store.AbstractTripleStore.quads false
com.bigdata.relation.namespace  test-ng-2
com.bigdata.btree.writeRetentionQueue.capacity  4000
com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers  true

What am I missing?

Community
  • 1
  • 1
kaychaks
  • 1,715
  • 3
  • 21
  • 28

3 Answers3

2

There are some RDF syntax issues, but the underlying reason is that Blazegraph does not support OWL Reasoning out of the box. See current support. There has been some work towards and ELK Reasoner.

Regarding the RDF in this example, here's an update that is validated to load in Blazegraph 1.5.1. It incorporates the feedbackup above and adds namespaces. I created a properties (test.properties) file with your properties above and loaded Blazegraph with the executable jar from Sourceforge.

java -Xmx2g -Dbigdata.propertyFile=test.properties -jar bigdata-bundled.jar

Go to the workbench: http://localhost:9999/bigdata/ and paste the RDF below into the "Update" tab on the workbench selecting "RDF Data" with the format "Turtle".

@prefix : <http://stackoverflow.com/> .
@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#> .

:eats rdf:type owl:ObjectProperty .

:Vegetable rdf:type owl:Class ;
   rdfs:subClassOf owl:Thing .

:Vegetarian rdf:type owl:Class ;
   owl:equivalentClass [ rdf:type owl:Restriction ;
                          owl:onProperty :eats ;
                          owl:someValuesFrom :Vegetable
                        ] .

:Carrot rdf:type :Vegetable ,
         owl:NamedIndividual .

:carrot rdf:type owl:NamedIndividual , owl:Thing, :Carrot .

:John rdf:type owl:NamedIndividual , owl:Thing ;
          :eats :carrot .

If you then go to the query tab and run something like:

select * where { ?s ?p ?o }

You'll see all of the triples inferred by the OWLAxiomsVocabulary.

Brad Bebee
  • 146
  • 3
1

The reason seems to be in the fact that in

:Carrot rdf:type :Vegetable ,

you start Carrot from a capital letter, but in

 :eats :carrot .

you use lowercase letter.

Dmitry Tsarkov
  • 768
  • 4
  • 11
  • But presumably carrot is an individual that is an *instance* of Carrot. Since eats is an object property, it wouldn't make sense to say that "John eats Carrot", since object properties relate individuals with other individuals, not classes. – Joshua Taylor Apr 23 '15 at 00:43
  • I think Carrot here is an individual, same as carrot. Just not necessarily the same one. – Ignazio Apr 23 '15 at 06:19
  • As the full definition of Carrot contains rdf:type owl:NamedIndividual, I think it is just a typo – Dmitry Tsarkov Apr 23 '15 at 16:38
  • Thanks for pointing to the typo, fixed that. However, that did not change anything. I am still not getting the desired output. – kaychaks Apr 27 '15 at 06:48
0

This data is not well formed yet:

:Carrot rdf:type :Vegetable ,
             owl:NamedIndividual .

:John rdf:type owl:NamedIndividual , owl:Thing ;
      :eats :carrot .

You'd also need to say that :carrot is an individual of type :Carrot, with an assertion like:

:carrot rdf:type owl:NamedIndividual , owl:Thing, :Carrot .

Then, since :carrot will be an instance of :Carrot, and :Carrot is a subclass of :Vegetable, you can infer that :carrot is an instance of :Vegetable, and thus that :John :eats some :Vegetable. If Blazegraph supports OWL reasoning (e.g., not just RDFS reasoning), that should be enough to let you infer that :John is a :Vegetarian (at least according to this non-standard definition of vegetarian).

Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353