0

I have a command

./bin/arq  --data ./bin/dbpedia_2015-10.nt  --query ./bin/166.rq 

which works perfect and I can see my result in my command line interface. I would like to use jena RIOT to have my result in the file.ttl . But as I am not familiar with commandline and linux I don't know how to do it. is there any suggestion. I dont want to use the dbpedia datasets niether I just need the results from my sparql query.

this is my code `

select DISTINCT ?instance ?domain ?range ?subClassOf  # 
where { 
   ?instance rdf:type ?type;
             rdfs:domain ?domain;
             rdfs:range ?range;
             rdfs:subClassOf* ?subClassOf.
}

` ' but I have the error when change it to construct '

construct { DISTINCT ?instance ?domain ?range ?subClassOf.}  
where { 
   ?instance rdf:type ?type;
             rdfs:domain ?domain;
             rdfs:range ?range;
             rdfs:subClassOf* ?subClassOf.
}
RobV
  • 28,022
  • 11
  • 77
  • 119

2 Answers2

1

It will be in Turtle syntax once you use a CONSTRUCT or DESCRIBE query.

UninformedUser
  • 8,397
  • 1
  • 14
  • 23
  • this is my code ` select DISTINCT ?instance ?domain ?range ?subClassOf # where { ?instance rdf:type ?type; rdfs:domain ?domain; rdfs:range ?range; rdfs:subClassOf* ?subClassOf. } ` ' but I have the error when change it to construct 'construct { DISTINCT ?instance ?domain ?range ?subClassOf.} where { ?instance rdf:type ?type; rdfs:domain ?domain; rdfs:range ?range; rdfs:subClassOf* ?subClassOf. } –  May 22 '17 at 13:40
1

As you say your aim is to produce Turtle output and Turtle is an RDF serialisation format you need to CONSTRUCT RDF triples. e.g.

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
CONSTRUCT { ?instance rdf:type ?type;
            rdfs:domain ?domain ;
            rdfs:range ?range;
            rdfs:subClassOf ?subClassOf .
}
where { 
   ?instance rdf:type ?type;
             rdfs:domain ?domain;
             rdfs:range ?range;
             rdfs:subClassOf* ?subClassOf.
}
chrisis
  • 1,983
  • 5
  • 20
  • 17
  • Although the answer is syntactically correct, semantically it doesn't make sense form my point of view. I mean, what is the goal of the query? Properties because of the domain and range statements? But what about the `subClassOf` triple pattern then? Is OWL 2 punning used, i.e. the property is also used as a class? Or should it more be `rdfs:subPropertyOf`? – UninformedUser May 22 '17 at 19:10