sparql

How to query a particular DBpedia Resource/Page for multiple entities?

别说谁变了你拦得住时间么 提交于 2019-12-10 12:17:03
问题 I have links to a number of DBpedia pages like: http://dbpedia.org/resource/Harry_Potter http://dbpedia.org/resource/Twilight_(series) http://dbpedia.org/resource/Bible http://dbpedia.org/resource/Manga I would like to get the Abstract and Thumbnail entities for each one of them. I can get them individually using: For Abstract: PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX res: <http://dbpedia.org/resource/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http:/

How to parameterize a SPARQL query in SWI Prolog?

偶尔善良 提交于 2019-12-10 11:42:10
问题 I am having difficulty making the following SPARQL query parametric. First I load the request library: ?- use_module(library(semweb/sparql_client)). % library(uri) compiled into uri 0.02 sec, 290,256 bytes % library(readutil) compiled into read_util 0.00 sec, 17,464 bytes % library(socket) compiled into socket 0.00 sec, 11,936 bytes % library(option) compiled into swi_option 0.00 sec, 14,288 bytes % library(base64) compiled into base64 0.00 sec, 17,912 bytes % library(debug) compiled into

SPARQL Query Error with OPTION(TRANSITIVE) on Jena

人盡茶涼 提交于 2019-12-10 11:03:17
问题 I have the following Query PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?type WHERE { { SELECT * WHERE { ?x rdfs:subClassOf ?type . } } OPTION (TRANSITIVE, t_distinct, t_in (?x), t_out (?type) ) . FILTER (?x = <http://dbpedia.org/ontology/Hospital>) } It works fine when i send it to Virtuoso endpoint but does not work on my Jena instance. In specific i get the following error: INFO [1] 400 Parse error: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?type WHERE { {

How to list all all graphs in Virtuoso?

霸气de小男生 提交于 2019-12-10 10:47:53
问题 When I go to http://localhost:8890/sparql/ , there are two fields: Default Data Set Name (Graph IRI) and query . How can I list what all graphs (that go in the former field) are available in my DB? The field is not mandatory and I can just run a query against all namespaces. But I would like to know how to list the graphs available. The only non-empty graph I was able to run was http://localhost:8890/sparql For example, in a relational database environment, I believe this kind of info could

No result found on delete

烈酒焚心 提交于 2019-12-10 10:10:00
问题 I have the following delete statement: delete {?s ?p ?o} {<http://www.example.org/test/unit213> ?p ?o. ?s ?p ?o} The URI http://www.example.org/test/unit213 is valid, since I get on select, among others, <http://www.example.org/test/unit213> rdf:type <http://www.example.org/test/unit> Still, I get the following result: No result Can anyone tell me why? 回答1: That's probably correct, SPARQL Update operations aren't supposed to return any results. By the way, I would discourage that style of

Query dbpedia sparql endpoint using dotnetRDF - RDFParseException

≯℡__Kan透↙ 提交于 2019-12-10 10:03:29
问题 When I execute the following query on http://dbpedia.org/sparql using (dotnetRDF) VDS.RDF.Query.SparqlRemoteEndpoint.QueryWithResultSet() everything works fine. SELECT ?film ?p ?o WHERE { ?film <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Japanese_films> . ?film ?p ?o } limit 500 But when I try this query using SparqlRemoteEndpoint.QueryWithResultGraph() CONSTRUCT { ?film ?p ?o} WHERE { ?film <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category

Can SPARQL (Jena) UPDATEs be parameterized by collections of literals (instead of literals)?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 09:56:32
问题 Can I call a parameterized SPARQL UPDATE (as in Jena's ParameterizedSparqlString ) to set a property to several e.g. literal values? For instance, I have: Set<String> object = new HashSet<String>(Arrays.asList("literal1", "literal2")); and would like to use a SPARQL update such as: INSERT { [] property ?object } WHERE {} to build these RDF statements: _:SUBJECT property "literal1" . _:SUBJECT property "literal2" . Does Jena support this kind or parametrization (the signature of

Encoding problems with R XML via SPARQL

回眸只為那壹抹淺笑 提交于 2019-12-10 07:16:20
问题 I running into an encoding problem with the SPARQL package for R. I'm running the following code: library(SPARQL) rights_query <- ' PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX edm: <http://www.europeana.eu/schemas/edm/> PREFIX ore: <http://www.openarchives.org/ore/terms/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT DISTINCT ?edmrights ?provider (COUNT(*) as ?count) WHERE { ?agg rdf:type ore:Aggregation . ?agg edm:rights ?edmrights . #?agg dc:rights ?dcrights .

SPARQL - query a property and return results for a related property

牧云@^-^@ 提交于 2019-12-10 06:06:23
问题 I am new to SPARQL and I am trying to run a SPARQL query so that I return the results for a property and list against this the value for a related property. Example code being: SELECT ?player ?position ?club ?goals WHERE { ?player a <http://dbpedia.org/ontology/SoccerManager> . filter (contains (str(?player), "Alan_Shearer")) . ?player <http://dbpedia.org/ontology/position> ?position . ?player <http://dbpedia.org/property/clubs> ?club . ?player <http://dbpedia.org/property/goals> ?goals . }

Multiple SPARQL “INSERT WHERE” queries in a single request

我的梦境 提交于 2019-12-10 04:21:13
问题 My question is similar to what was asked on this thread Is it possible to combine those 2 SPARQL INSERT into one? I want to have multiple INSERT WHERE statements in a query, but for different subjects. I will like to test a particular value ("testValueN") and if present would like to insert a new triple for that subject. An example of it would be, PREFIX Sensor: <http://example.com/Equipment.owl#> { INSERT { ?subject1 Sensor:test2 'newValue1' . } WHERE { ?subject1 Sensor:test1 'testValue1' .