sparql

how to programmatically get all available information from a Wikidata entity?

怎甘沉沦 提交于 2021-02-08 06:52:22
问题 I'm really new to wikidata. I just figured that wikidata uses a lot of reification. Suppose we want to get all information available for Obama. If we are going to do it from DBpedia, we would just use a simple query: select * where {<http://dbpedia.org/resource/Barack_Obama> ?p ?o .} This would return all the properties and values with Obama being the subject. Essentially the result is the same as this page: http://dbpedia.org/page/Barack_Obama while the query result is in a format I needed.

how to programmatically get all available information from a Wikidata entity?

*爱你&永不变心* 提交于 2021-02-08 06:51:39
问题 I'm really new to wikidata. I just figured that wikidata uses a lot of reification. Suppose we want to get all information available for Obama. If we are going to do it from DBpedia, we would just use a simple query: select * where {<http://dbpedia.org/resource/Barack_Obama> ?p ?o .} This would return all the properties and values with Obama being the subject. Essentially the result is the same as this page: http://dbpedia.org/page/Barack_Obama while the query result is in a format I needed.

how to programmatically get all available information from a Wikidata entity?

此生再无相见时 提交于 2021-02-08 06:50:17
问题 I'm really new to wikidata. I just figured that wikidata uses a lot of reification. Suppose we want to get all information available for Obama. If we are going to do it from DBpedia, we would just use a simple query: select * where {<http://dbpedia.org/resource/Barack_Obama> ?p ?o .} This would return all the properties and values with Obama being the subject. Essentially the result is the same as this page: http://dbpedia.org/page/Barack_Obama while the query result is in a format I needed.

Working with SPARQL lists in dotNETRDF - intersection of lists

不羁的心 提交于 2021-02-08 05:41:47
问题 I'm using dotNetRDF and am having a hard time understanding how to use the provided list helpers. Currently I'm not using a list, just one item like so: paramString.SetParameter("nickname", g.CreateLiteralNode(nicknameString)); paramString.CommandText = @"INSERT DATA { data:person_1 app:nickname @nickname. }"; But now I need to account for multiple nicknames: //doesn't work with array, and there's no "CreateListNode()" //paramString.SetParameter("nicknames", g.CreateLiteralNode(nicknamesArray

Working with SPARQL lists in dotNETRDF - intersection of lists

房东的猫 提交于 2021-02-08 05:41:27
问题 I'm using dotNetRDF and am having a hard time understanding how to use the provided list helpers. Currently I'm not using a list, just one item like so: paramString.SetParameter("nickname", g.CreateLiteralNode(nicknameString)); paramString.CommandText = @"INSERT DATA { data:person_1 app:nickname @nickname. }"; But now I need to account for multiple nicknames: //doesn't work with array, and there's no "CreateListNode()" //paramString.SetParameter("nicknames", g.CreateLiteralNode(nicknamesArray

use another sparql inside sparql IN clause

强颜欢笑 提交于 2021-02-07 12:28:24
问题 I'm using SPARQL and I wonder if I can put an sparql inside in clause? To be more specific, I need to get entities(s1,s2) who have specific condition for this sparql query[s1's aggregate value over a field is more than say 5] select ?s1 ?x ?s2. WHERE { {?s1 rdf:type dbpedia-owl:Scientist.} {?s2 rdf:type dbpedia-owl:Scientist.} {?s2 dbpedia-owl:field ?x.} {?s1 dbpedia-owl:field ?x.} } so I need to add an extra IN clause like this SELECT ?s1 ?x ?s2. WHERE { {?s1 rdf:type dbpedia-owl:Scientist.}

How to get Dbpedia Spotlight annotations and candidates with filter sparql in python?

眉间皱痕 提交于 2021-02-05 09:36:04
问题 I have this sql in Sparql. SELECT DISTINCT ?issue WHERE { VALUES ?issue { <http://dbpedia.org/resource/Deforestation> <http://dbpedia.org/resource/Pollution> <http://dbpedia.org/resource/Wast> } ?issue ?a ?b} I encode the query on this website https://urldecode.org/ and it looks like this %20%20%20%20SELECT%20DISTINCT%20%3Fissue%20WHERE%20%7B%20%20%20%20%20VALUES%20%3Fissue%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FDeforestation

How to get Dbpedia Spotlight annotations and candidates with filter sparql in python?

倾然丶 夕夏残阳落幕 提交于 2021-02-05 09:35:20
问题 I have this sql in Sparql. SELECT DISTINCT ?issue WHERE { VALUES ?issue { <http://dbpedia.org/resource/Deforestation> <http://dbpedia.org/resource/Pollution> <http://dbpedia.org/resource/Wast> } ?issue ?a ?b} I encode the query on this website https://urldecode.org/ and it looks like this %20%20%20%20SELECT%20DISTINCT%20%3Fissue%20WHERE%20%7B%20%20%20%20%20VALUES%20%3Fissue%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FDeforestation

What is a smallest set of indices that allows to fully bind any pattern of 6-tuple in one hop?

不问归期 提交于 2021-02-04 21:13:20
问题 I am trying to build a 6-tuple store on top of wiredtiger. The tuples can be described as follow: (graph, subject, predicate, object, alive, transaction) Every tuple stored in the database is unique. Queries are like regular SPARQL queries except that the database store 6 tuples. Zero of more elements of a tuple can be variable. Here is an example query that allows to retrieve all changes introduces by a particular transaction P4X432 : SELECT ?graph ?subject ?predicate ?object ?alive WHERE {

listOfDict to RDF conversion in python targeting Apache Jena Fuseki

…衆ロ難τιáo~ 提交于 2021-01-29 17:53:19
问题 To store some data in Apache Jena from python I'd like to have a generic conversion from a list of Dicts to RDF and possibly back on query. For the list of Dict to RDF part I tried implementing "insertListofDicts" (see below) and tested it with "testListOfDictInsert" (see below). The result is below which leads to a 400: Bad Request when tried with an Apache Jena Fuseki server. What needs to be fixed for simple string types - and may be for other primitive Python types to get this working?