sparql

Strange behavior of content negotiation concerning SPARQL CONSTRUCT query

我的梦境 提交于 2021-01-29 08:28:40
问题 When issuing a SPARQL CONSTRUCT query to a specific endpoint, Apache Jena library 3.14.0 issues an error message as follows. Endpoint returned Content Type: application/sparql-results+xml which is not a valid RDF syntax The code I wrote is as follows. QueryEngineHTTP qeh = new QueryEngineHTTP(endpointUrl, rq); qeh.setAcceptHeader("application/rdf+xml"); Model m = qeh.execConstruct(); The endpoint is https://id.nlm.nih.gov/mesh/sparql . The query is as follows. CONSTRUCT {?s <http://id.nlm.nih

Does Blazegraph support range query optimization?

谁说我不能喝 提交于 2021-01-29 06:41:01
问题 I am playing with Blazegraph. I insert some triples representing 'events', each of 'event' contains 3 triples and looks like this: <%event-iri%> <http://predicates/timestamp> '2020-01-02T03:04:05.000Z'^^xsd:dateTime . <%event-iri%> <http://predicates/a> %RANDOM_UUID% . <%event-iri%> <http://predicates/b> %RANDOM_UUID% . Timestamps represent consecutive moments of time, each next event is 1 minute later than the previous one. I made two sets of tests: once having 1 million events (so 3 million

fuseki Multiple services found exception

妖精的绣舞 提交于 2021-01-29 04:17:21
问题 I was using this config and it is working @prefix : <#> . @prefix fuseki: <http://jena.apache.org/fuseki#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . [] rdf:type fuseki:Server ; fuseki:services ( <#serviceTDBwithReasoner> # <#serviceInMemoryWithReasoner> ) . # TDB tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .

fuseki Multiple services found exception

南笙酒味 提交于 2021-01-29 04:08:00
问题 I was using this config and it is working @prefix : <#> . @prefix fuseki: <http://jena.apache.org/fuseki#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . [] rdf:type fuseki:Server ; fuseki:services ( <#serviceTDBwithReasoner> # <#serviceInMemoryWithReasoner> ) . # TDB tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .

Find superclasses and sort by distance in SPARQL

痞子三分冷 提交于 2021-01-29 02:21:32
问题 I'm finding all the superclasses of a type, and all the superclasses of that type, and so on all the way up. I'm doing this using the + operator: SELECT ?superclass WHERE{ <myType> <superclassPredicate>+ ?superclass } I would like to get these superclasses back in a reasonable order (eg most specific to least specific). Is there a way to guarantee this? I'm familiar with ORDER BY, but I'm not sure what to put into it. To put it another way: can I keep track of how many "jumps" are made by the

Find superclasses and sort by distance in SPARQL

冷暖自知 提交于 2021-01-29 02:13:50
问题 I'm finding all the superclasses of a type, and all the superclasses of that type, and so on all the way up. I'm doing this using the + operator: SELECT ?superclass WHERE{ <myType> <superclassPredicate>+ ?superclass } I would like to get these superclasses back in a reasonable order (eg most specific to least specific). Is there a way to guarantee this? I'm familiar with ORDER BY, but I'm not sure what to put into it. To put it another way: can I keep track of how many "jumps" are made by the

Why does this SPARQL query return certain items as subjects?

好久不见. 提交于 2021-01-28 00:35:55
问题 I have the following data graph: @prefix hr: <http://learningsparql.com/ns/humanResources#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix sch: <http://schema.org/> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . hr:Another a rdfs:Class . hr:Employee a rdfs:Class ; rdfs:label "model" ; rdfs:comment "a good employee" . hr:Longer a hr:Employee ; rdfs:label

URLError with SPARQLWrapper at sparql.query().convert()

和自甴很熟 提交于 2021-01-28 00:21:16
问题 I try a small python script to test my SPARQL request. However, just the next simple code doesn't work. from SPARQLWrapper import SPARQLWrapper, JSON import rdflib #connect to the sparql point sparql = SPARQLWrapper("http://localhost:3030/sparql") #SPARQL request sparql.setQuery(""" 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#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX

moving a rdf ordered list from a graph to another with sparql

只愿长相守 提交于 2021-01-27 19:01:38
问题 I have a list in a rdf knowledge graph in a Fuseki dataset. I can get the elements of the list with something like select ?webpage where { graph <http://datamusee.givingsense.eu/graph/webtracks> { ?track <http://erlangen-crm.org/current/P16_used_specific_object> ?content. ?content rdf:rest*/rdf:first ?webpage . } } but I would like to copy the list from the webtracks graph to another graph I doen't find how to do it either with an insert or by exporting the data with a construct and then

SPARQL Construct Clause to include predicate literals

╄→гoц情女王★ 提交于 2021-01-27 18:11:21
问题 I'm trying to use SPARQL CONSTRUCT to strip a set of data from dbpedia - I'm only interested in a set of Artists, and I want Sesame as small as possible for speed. What I thought I could do is use CONSTRUCT to get every predicate for a given artist. I can get the first CONSTRUCT clause working to make sure I get type "Person", but that only gives me triples satisfying that clause - I want their names, labels, birthPlaces etc to. My query below is trying to capture Monet's name in the second