sparql

Syntax for Sparql query for pages with specific infobox

一笑奈何 提交于 2019-12-13 04:39:28
问题 I'm trying Sparql for the first time (on dbpedia) and can't get any queries to work. Everything I try returns a syntax error or an empty dataset. For example, I tried the queries on this page. They didn't work, so I made the following changes: - I read that wikiPageUsesTemplate has changed to http://dbpedia.org/ontology/wikiPageUsesTemplate, - I add 'WHERE' to select statement, though I guess that must be optional, - I reduced the whole thing to a minimum: just the infobox clause. But it

Is it possible to return relationships between two objects in SPARQL?

北城余情 提交于 2019-12-13 04:39:06
问题 I am a beginner in SPARQL and I would like to know if it is possible to return relationships between two objects. For example I would like to write a SPARQL query which returns the relationship between Thierry Henry and Arsenal in dbpedia. 回答1: SELECT ?relationship WHERE { <http://dbpedia.org/resource/Thierry_Henry> ?relationship <http://dbpedia.org/resource/Arsenal_F.C.> } i.e.: show me the predicates ( ?relationship ) where the subject is the DBPedia resource Thierry_Henry and the object is

Sparql about dbpedia:World_Wide_Web

[亡魂溺海] 提交于 2019-12-13 04:36:17
问题 I'm new to the semantic web and I'm trying to figure out how to write a SPARQL query to extract from dbpedia everything about a particular subject. Not just it's proprieties, but also everything related to it. I'm not even sure how to start such a query. I would like to get all triples about the World Wide Web. PREFIX dbpedia: <http://dbpedia.org/resource/> SELECT DISTINCT ?s ?p ?o WHERE { ?s ?p ?o . ?s ?p dbpedia:World_Wide_Web # FILTER( lang(?s) = "en" ) -- doesn't work with filter }Limit

performing sparql query on the rdf data stored in relational database

我是研究僧i 提交于 2019-12-13 04:33:34
问题 I have stored large amount of RDF data into a relational database with the help of rdflib_sqlalchemy.SQLAlchemy.Now I want to execute Sparql query over the same.I can not find any thing to know how to implement sparql query here. Can anyone help. 回答1: Including sample code would make it easier to know what you are after but see the documentation on querying an RDFLib graph with SPARQL. Using the example from the rdflib-sqlalchemy README where graph is the name of the open graph. rq = "select

How to add special categories in sparqlwrapper in python

你离开我真会死。 提交于 2019-12-13 04:28:16
问题 I am using the following sparql query using sparqlwrapper as follows. from SPARQLWrapper import SPARQLWrapper, JSON sparql = SPARQLWrapper("http://live.dbpedia.org/sparql") sparql.setReturnFormat(JSON) my_category = 'dbc:Meteorological_concepts' sparql.setQuery(f" ASK {{ {my_category} skos:broader{{1,3}} dbc:Medicine }} ") results = sparql.query().convert() print(results['boolean']) As mentioned above it works fine with categories that do not have brackets (e.g., dbc:Meteorological_concepts )

Retrieve triples with properties restricted by namespace [duplicate]

筅森魡賤 提交于 2019-12-13 04:13:28
问题 This question already has an answer here : SPARQL - Restricting Result Resource to Certain Namespace(s) (1 answer) Closed 6 years ago . Given a resource http://foo.com/res1 that is the subject of several of triples with properties from two different ontologies: <http://foo.com/res1> dc:author <http://ppl.com/bob> <http://foo.com/res1> dc:title "some resource" <http://foo.com/res1> foaf:depiction <http://flickr.com/picture/1234> I want to obtain all the triples with properties in the dc

How to get grand total in a sparql group by query

橙三吉。 提交于 2019-12-13 04:06:03
问题 I follow up on query where the schema.org database is used to find the number of children of a class. The answer gives for each class the number of children. In my application I need the grand total of all children (i.e. the sum of the counts for each group) in order to compute for each group the percentage of the total number of children. The query I got from the previous question is: prefix schema: <http://schema.org/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?child

How to add a list as a parameter in sparql query in python

社会主义新天地 提交于 2019-12-13 03:51:59
问题 I am using SPARQLWrapper as follows to run my wikidata query. from SPARQLWrapper import SPARQLWrapper, JSON import pandas as pd sparql = SPARQLWrapper("https://query.wikidata.org/sparql") sparql.setQuery(""" SELECT DISTINCT ?item { VALUES ?searchTerm { "word2vec" "fasttext" "natural language processing" "deep learning" "support vector machine" } SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "EntitySearch". bd:serviceParam wikibase:endpoint "www.wikidata.org". bd:serviceParam wikibase

dbpedia sparql query returns 0 result

爱⌒轻易说出口 提交于 2019-12-13 03:45:52
问题 I’m new to query languages and linked data so thanks a lot for the help. I also have a similar question about sparql on wikidata Wikidata sparql query returns 0 result I would like to look up all the art movements in dbpedia with the associated artists (associated with the movement -peopleNam, famous for the movement-famousName, influence the movement-influenceName) here is my query with lots of redundant prefix (that I could not enter because of the amount of links) SELECT ?movementName