Thanks for the reply! In terms of what I’m trying to get back, I was hoping to list in one row a list of names, and in another a list of locations (which you’ve helped me solve).
The dataset I am working with contains information about published articles and presentations. What I was hoping to do was to isolate all of the presentations, and then list where they took place and list whoever created the presentation to get a list of all of the creators and the locations they have visited. However, since the human-readable data of names is behind a reference that is unreadable, I was lead to the idea that nesting my queries would allow me to achieve this - as shown. I’m still having trouble getting jena fuseki to list the creator’s names beside their respective locations. Using the code you provided, I tried to make a separate query (which would be the second half of the first) to do the same with creator names. While this seems to run, it outputs nothing: PREFIX bibo: <http://purl.org/ontology/bibo/> PREFIX event: <http://purl.org/NET/c4dm/event.owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?creatorName ?creatorCountry WHERE { ?creatorName ?predicate ?creatorCountry . ?creatorInfo foaf:name ?creatorName . ?publication <http://purl.org/dc/terms/creator> ?creatorInfo . ?publication bibo:presentedAt ?place . ##1 } LIMIT 500 On 2020/03/18 22:25:57, Andy Seaborne <[email protected]> wrote: > Hi Adam, > > PREFIX bibo: <http://purl.org/ontology/bibo/> > PREFIX event: <http://purl.org/NET/c4dm/event.owl#> > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> > SELECT ?creatorName ?creatorCountry > WHERE > { > ?creatorName ?predicate ?creatorCountry . > ?locationName rdfs:label ?creatorCountry . > ?locationInfo event:place ?locationName . > ?publication bibo:presentedAt ?locationInfo . > ?publication bibo:presentedAt ?place . ##1 > } LIMIT 500 > > > and the last part (##1) does not add anything but may cause duplication > of results. > > The output order of rows is not fixed. > > What output are trying to get back? > > On 18/03/2020 21:10, Adam Davies wrote: > > Dear all, > > I have been attempting to use jena fuseki to perform a query on a large > > dataset. However, due to the nature of this dataset, and my current > > inexperience with jena fuseki - being a new user for a project in education > > - after some research into jena fuseki I found myself coming to the > > conclusion that I would need to nest my select queries to order my data in > > a human-readable fashion that I could work through efficiently. When I came > > to write these nested queries though, I was immediately given an error > > after the first nest. > > > Due to my lack of experience, I have struggled to find a solution to this > > problem, and came here for advice. Is anyone able to help me? I have > > attached aforementioned code below: > > SELECT ?creatorName ?creatorCountry > > WHERE > > {#BEGINMAINSELECT > > ?creatorName ?predicate ?creatorCountry > > {#BEGINNEST1 > > SELECT ?creatorCountry > > WHERE > > { > > ?locationName > > <http://www.w3.org/2000/01/rdf-schema#label> ?creatorCountry#Find out the > > human-readable name of the location the publication was presented at via > > it's reference > > } > > {#BEGINNEST2 > > There's a syntax error at line #BEGINNEST2 > > Was this meant? It removes the "}" on the line before #BEGINNEST2 > > SELECT ?a ?b ?c { > ?a :p [] . > { SELECT ?b { ?b :q ?x > { SELECT ?d { ?d :q ?y > { SELECT ?c { ?c :q ?z > }} > }} > }} > } > > > > > > SELECT ?locationName > > WHERE > > { > > ?locationInfo > > <http://purl.org/NET/c4dm/event.owl#place> ?locationName#Find out the name > > reference of the location the publication was presented at > > } > > {#BEGINNEST3 > > SELECT ?locationInfo > > WHERE > > { > > ?publication > > <http://purl.org/ontology/bibo/presentedAt> ?locationInfo#Select each > > publication retrieved from the below query and find out where they were > > presented at > > } > > {#BEGINNEST4 > > SELECT ?publication > > WHERE > > { > > ?publication > > <http://purl.org/ontology/bibo/presentedAt> ?place#Select all publications > > with predicate 'presented at' > > } > > }#ENDNEST4 > > }#ENDNEST3 > > }#ENDNEST2 > > }#ENDNEST1 > > } > > LIMIT 500 > > >
