How to get inference by command line tool 'sparql'

24 views
Skip to first unread message

chetan moradiya

unread,
Jun 30, 2014, 5:54:41 PM6/30/14
to ontolog...@googlegroups.com
A
|_P(p1,p2)
|     |_M(m1,m2)
|
B

I want to get A's all instances.

My query is

SELECT ?x
    WHERE { 
            ?x rdf:type :A .}

Output must be: A(p1,p2,m1,m2)

How to get this result using command line tool 'sparql'?. Means I want to get inference here.

My OWL file is here:

<rdf:RDF xmlns="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" <owl:Ontology rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11"/> <owl:Class rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#A"> <owl:Class rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#B"> <owl:Class rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#M"> <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#P"/> </owl:Class> <owl:Class rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#P"> <rdfs:subClassOf rdf:resource="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#A"/> </owl:Class> <owl:NamedIndividual rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#m1"> <rdf:type rdf:resource="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#M"/> </owl:NamedIndividual> <owl:NamedIndividual rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#m2"> <rdf:type rdf:resource="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#M"/> </owl:NamedIndividual> <owl:NamedIndividual rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#p1"> <rdf:type rdf:resource="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#P"/> </owl:NamedIndividual> <owl:NamedIndividual rdf:about="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#p2"> <rdf:type rdf:resource="http://www.semanticweb.org/chetan/ontologies/2014/5/untitled-ontology-11#P"/> </owl:NamedIndividual> </rdf:RDF>

If I execute this query without reasoner then i use this code from cmd..... sparql --data owl file name --query query text file

e.g. sparql --data demo.owl --query query.text

Reply all
Reply to author
Forward
0 new messages