Thanks Lorenz, Rob and Andy. You kindly answered my next question for the namespace of the graph, where to define it. I used Andy's safer query to specify the GRAPH as follows:
prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?class ?label ?description WHERE { GRAPH <http://myxyz.com/folder1/exampleulo> { ?class a owl:Class. OPTIONAL { ?class rdfs:label ?label} OPTIONAL { ?class rdfs:comment ?description} } } This does not work either. There is definitely something wrong that I am doing. Is this to do with how we configure Fuseki? Regards Lorenz, to your question, I am pasting the JSON output for query results for the query SELECT * { { ?s ?p ?o } UNION { GRAPH ?g {?s ?p ?o } } } on the turtle file. In every result, the fourth line corresponds to the graph g after the first three (subject, predicate, object) [START OF OUTPUT] 1 <http://myxyz.com/folder1/exampleulo#part_of> rdf:type <http://www.w3.org/2002/07/owl#ObjectProperty> <http://localhost:3030/ds/data/exmpttl> 2 <http://myxyz.com/folder1/exampleulo#mechanism> rdf:type <http://www.w3.org/2002/07/owl#ObjectProperty> <http://localhost:3030/ds/data/exmpttl> 3 <http://myxyz.com/folder1/exampleulo#carries> rdf:type <http://www.w3.org/2002/07/owl#ObjectProperty> <http://localhost:3030/ds/data/exmpttl> 4 <http://myxyz.com/folder1/exampleulo#Component> <http://www.w3.org/2000/01/rdf-schema#comment> "This concept refers to components of a machine." <http://localhost:3030/ds/data/exmpttl> 5 <http://myxyz.com/folder1/exampleulo#Component> rdf:type <http://www.w3.org/2002/07/owl#Class> <http://localhost:3030/ds/data/exmpttl> 6 <http://myxyz.com/folder1/exampleulo#diagnoses> rdf:type <http://www.w3.org/2002/07/owl#ObjectProperty> <http://localhost:3030/ds/data/exmpttl> 7 <http://myxyz.com/folder1/exampleulo#functionally_part_of> rdf:type <http://www.w3.org/2002/07/owl#ObjectProperty> <http://localhost:3030/ds/data/exmpttl> 8 <http://myxyz.com/folder1/exampleulo> rdf:type <http://www.w3.org/2002/07/owl#Ontology> <http://localhost:3030/ds/data/exmpttl> 9 <http://myxyz.com/folder1/exampleulo> <http://www.w3.org/2002/07/owl#versionIRI> <http://myxyz.com/folder1/exampleulo> <http://localhost:3030/ds/data/exmpttl> 10 <http://myxyz.com/folder1/exampleulo#power_source> rdf:type <http://www.w3.org/2002/07/owl#ObjectProperty> <http://localhost:3030/ds/data/exmpttl> 11 <http://myxyz.com/folder1/exampleulo#contains> rdf:type <http://www.w3.org/2002/07/owl#ObjectProperty> <http://localhost:3030/ds/data/exmpttl> [END OF THE OUPUT] Regards Mahmood -----Original Message----- From: Lorenz B. [mailto:[email protected]] Sent: 20 October 2016 09:15 To: [email protected] Subject: Re: Fuseki 2.4.0 web user interface Can you please share the output of the general query? Jjust that we can see whether the triples have been loaded into a named graph or something which ta least is not the default graph. > Hi Lorenz, > > What I meant by Andy's query statement working is that it returned all the 11 > triples of my turtle file. His suggested query contained a union of graph > within the SELECT statement. > > SELECT * { { ?s ?p ?o } UNION { GRAPH ?g {?s ?p ?o } } } > > Next, I tried the OWL version of the same file both in OWL and RDF/XML format > with the query statement: > > prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: > <http://www.w3.org/2000/01/rdf-schema#> > > SELECT DISTINCT ?class ?label ?description WHERE { > ?class a owl:Class. > OPTIONAL { ?class rdfs:label ?label} > OPTIONAL { ?class rdfs:comment ?description} } LIMIT 25 > > This did not return the query result as I expected it to return the only > class it contained. > > Perhaps this clarifies it better. I also tried to simply the query (below) > but no results. > > SELECT DISTINCT ?c > WHERE { > ?c a owl:Class. > } > > Any suggestions, I'll appreciate. > Regards > > Mahmood > -----Original Message----- > From: Lorenz B. [mailto:[email protected]] > Sent: 20 October 2016 08:52 > To: [email protected] > Subject: Re: Fuseki 2.4.0 web user interface > > Hello Mahmood, > > you said the general query from Andy "works" and now you say that there was > no output. If this query doesn't return anything, your triple store is empty. > > > , > Lorenz > >> There was no output at all through the general query. >> >> Now I am working with an OWL file and get all the concepts (It has only one >> concept). The query I am running is: >> >> prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: >> <http://www.w3.org/2000/01/rdf-schema#> >> >> SELECT DISTINCT ?class ?label ?description WHERE { >> ?class a owl:Class. >> OPTIONAL { ?class rdfs:label ?label} >> OPTIONAL { ?class rdfs:comment ?description} } LIMIT 25 >> >> The OWL file is uploaded successfully but there is no result of the query. >> >> Any thoughts, I'll appreciate. >> >> Regards >> >> -----Original Message----- >> From: Andy Seaborne [mailto:[email protected]] >> Sent: 19 October 2016 15:55 >> To: [email protected] >> Subject: Re: Fuseki 2.4.0 web user interface >> >> >> >> On 19/10/16 15:44, Mahmood Ahmad wrote: >>> Ah, your query works! >>> >>> I had just missed a '}' character in the end. >>> >>> Thanks Andy, but why did my query not work. It was: >>> >>> SELECT ?subject ?predicate ?object >>> WHERE { >>> ?subject ?predicate ?object >>> } >>> LIMIT 25 >> Please note that I can't see your screen so I can't see what the output to >> the general query was. >> >> But I guess it has the G column set. Named graph not default graph. >> >> >>> Regards >>> >>> -----Original Message----- >>> From: Andy Seaborne [mailto:[email protected]] >>> Sent: 19 October 2016 15:25 >>> To: [email protected] >>> Subject: Re: Fuseki 2.4.0 web user interface >>> >>> The list does not pass attachments through. >>> >>> How are you runnign the server exactly? >>> >>> >>> Ask this query: >>> >>> SELECT * { { ?s ?p ?o } UNION { GRAPH ?g {?s ?p ?o } } } >>> >>> and don't forget to press the "query" button (it caches results otherwise). >>> >>> Andy >>> >>> >>> >>> On 19/10/16 14:23, Mahmood Ahmad wrote: >>>> Andy, >>>> >>>> I used a simple ulo.ttl file (owl file converted to ttl format) to >>>> upload on dataset /ds (Fuseki 2.4.0) and ran a simple query to get >>>> all triples. The file uploaded correctly but generated no result in >>>> query results portion of the Fuseki v2.4.0 web UI, although there >>>> are >>>> 11 triples in ulo.ttl >>>> >>>> The ttl file is attached. There was no result from the execution of query, >>>> nor a message of success/failure. >>>> >>>> Please can you suggest something so that I could get some output from the >>>> query? >>>> >>>> Regards >>>> Mahmood >>>> >>>> >>>> >>>> -----Original Message----- >>>> From: Andy Seaborne [mailto:[email protected]] >>>> Sent: 19 October 2016 13:57 >>>> To: [email protected] >>>> Subject: Re: Fuseki 2.4.0 web user interface >>>> >>>> Note what it says at the top of the page: >>>> >>>> """ >>>> This page covers Fuseki v1. As of Jena 2.13.0, there is also a new >>>> version, Fuseki v2. See Fuseki2 documentation. Both Fuseki v1 and >>>> Fuseki >>>> v2 are currently active and maintained. >>>> """ >>>> >>>> You are looking at Fuseki1 documentation. >>>> >>>> Andy >>>> >>>> On 19/10/16 13:54, Andy Seaborne wrote: >>>>> It is looking for a file called tdb.ttl which is not found. >>>>> >>>>> --desc is for a assembler file - you have to provide that, the >>>>> documentation is out of date. >>>>> >>>>> If all you eant is some small data for experimentation: >>>>> >>>>> fuseki-server --file <YourData.ttl> /ds >>>>> >>>>> will work >>>>> >>>>> If you have a TDB database, >>>>> >>>>> fuseki-server --loc <YourDB> /ds >>>>> >>>>> Andy >>>>> >>>>> On 19/10/16 12:39, Mahmood Ahmad wrote: >>>>>> Hi, >>>>>> >>>>>> [I am using Apache Jena Fuseki 2.4.0 on a Windows 10 machine] >>>>>> >>>>>> Can anyone please point me to the tdb.ttl for running a few >>>>>> practice SPARQL queries? The Apache Jena says that TDB is a part >>>>>> of Apache Jena >>>>>> 3.1.0 on the following page: >>>>>> >>>>>> http://jena.apache.org/documentation/tdb/index.html >>>>>> >>>>>> I have installed Fuseki 2.4.0 and I am looking to run the Fuseki >>>>>> Server with tdb.ttl using the command: >>>>>> fuseki-server --desc tdb.ttl /ds >>>>>> >>>>>> as given on the page: >>>>>> https://jena.apache.org/documentation/serving_data/ >>>>>> >>>>>> The error I get is as follows: >>>>>> >>>>>> C:\Users\mahmo_myz922s\apache-jena-fuseki-2.4.0\apache-jena-fuseki-2. >>>>>> 4.0>fuseki-server >>>>>> --desc tdb.ttl /ds >>>>>> [2016-10-19 12:14:49] Server INFO Dataset from assembler >>>>>> org.apache.jena.sparql.ARQException: Failed reading assembler >>>>>> description: Not found: tdb.ttl >>>>>> at >>>>>> org.apache.jena.sparql.core.assembler.AssemblerUtils.readAssemble >>>>>> r >>>>>> F >>>>>> i >>>>>> l >>>>>> e(AssemblerUtils.java:91) >>>>>> >>>>>> at >>>>>> org.apache.jena.sparql.core.assembler.AssemblerUtils.build(Assemb >>>>>> l >>>>>> e >>>>>> r >>>>>> U >>>>>> tils.java:104) >>>>>> >>>>>> at arq.cmdline.ModAssembler.create(ModAssembler.java:72) >>>>>> at >>>>>> arq.cmdline.ModDatasetAssembler.createDataset(ModDatasetAssembler. >>>>>> j >>>>>> a >>>>>> v >>>>>> a:43) >>>>>> >>>>>> at >>>>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.processModule >>>>>> s >>>>>> A >>>>>> n >>>>>> d >>>>>> Args(FusekiCmd.java:284) >>>>>> >>>>>> at jena.cmd.CmdArgModule.process(CmdArgModule.java:52) >>>>>> at jena.cmd.CmdMain.mainMethod(CmdMain.java:92) >>>>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:58) >>>>>> at jena.cmd.CmdMain.mainRun(CmdMain.java:45) >>>>>> at >>>>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(Fus >>>>>> e >>>>>> k >>>>>> i >>>>>> C >>>>>> md.java:102) >>>>>> >>>>>> at >>>>>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67) >>>>>> >>>>>> Any ideas, I'll appreciate. >>>>>> >>>>>> Regards >>>>>> Mahmood >>>>>> >>>>>> Mahmood Ahmad, PhD >>>>>> (Semantic Information Architect) >>>>>> > -- > Lorenz Bühmann > AKSW group, University of Leipzig > Group: http://aksw.org - semantic web research center > > > -- Lorenz Bühmann AKSW group, University of Leipzig Group: http://aksw.org - semantic web research center
