sparql

Where I can find some rdf and some sparql queries to practise to write in sparql?

柔情痞子 提交于 2019-12-11 08:53:58
问题 I am trying to practice myself in writing some SPARQL queries. Does anybody know where I can find the best material? Where I can find some RDF file and some tasks to try to write my own SPARQL queries. I am good with SQL, and I just need some material to learn to write in SPARQL. 回答1: All sample RDF and queries from the O'Reilly book "Learning SPARQL" are available on the book's home page at learningsparql.com. (Full disclosure: I wrote it.) 回答2: data.gov and DataHub have a lot of

delete rest api to remove statements from global context

我们两清 提交于 2019-12-11 08:25:14
问题 I send the following http request to Sesame Server: params = { 'subj' : '?s', 'pred' : 'rdf:type', 'obj' : 'Device' } Also tried: params = { 'pred' : 'rdf:type', 'obj' : 'Device' } which translates to: http://example.com/openrdf-sesame/repositories/devices/statements?pred=rdf%3Atype&subj=%3Fs&obj=Device I perform following operation on params in PYTHON: urllib.urlencode(params)) I get Response: 400 (Bad Request). Please help resolving this issue. I think its related to improper encoding of

Dbpedia resource parsing in JAVA

感情迁移 提交于 2019-12-11 08:14:38
问题 By using DBpedia Spotlight, I get DBpedia URIs. For example http://dbpedia.org/resource/Part-of-speech_tagging I need to request this URI in Java so that it can return me some json/xml and I can fetch the necessary information from the response. For example, in the above mentioned URI, I need the value of dct:subject Below is the screenshot of the response what I get in the browser. 回答1: There isn't enough info in your question about what you're trying to achieve to provide the best path by

Difference in performance between using VALUES keyword and using directly the URI in the query?

血红的双手。 提交于 2019-12-11 07:49:35
问题 I have a fairly complex SPARQL query with the structure outlined below, involving multiple graph patterns, UNION and nested FILTER NOT EXISTS . I want the query to remain generic, and I want to be able to inject values for certain variables at execution time, and my idea is to append a VALUES keyword at the end of the query to specify the value of certain variables in the query. In the structure below, I set the value of ?x , and I illustrate all the places in the query where ?x applies.

What is the SPARQL query to check if a graph exists and return a message?

荒凉一梦 提交于 2019-12-11 07:46:41
问题 I want to check if the graph exists in my Fuseki server and if it does, it should return a message like The graph exists 回答1: You can do this with an ASK query. For example, to check that a named graph http://example.org/graph1 exists, you can do this: ASK WHERE { GRAPH <http://example.org/graph1> { ?s ?p ?o } } It will return true if it exists, false otherwise. 来源: https://stackoverflow.com/questions/27080839/what-is-the-sparql-query-to-check-if-a-graph-exists-and-return-a-message

SPARQL Construct. How to assign the value of an RDF attribute to an actual RDF variable

本秂侑毒 提交于 2019-12-11 07:36:26
问题 My query (excerpt) is roughly this. CONSTRUCT { ?publication fb:type ?type; fb:publicationType ?publicationType; } WHERE { ?publication a bibo:Document . ?publication vitro:mostSpecificType ?publicationType . } And it returns output similar to... <rdf:Description rdf:about="https://abcd.fgh/individual/publication12345"> <fb:publication>Example pub title</fb:publication> <fb:publicationType rdf:resource="http://purl.org/ontology/bibo/AcademicArticle"/> </rdf:Description> Perhaps a beginner

Sparql query containment result

匆匆过客 提交于 2019-12-11 07:35:40
问题 Not familiar with semantic web, under the following context: // owl in terms of Java-like syntax Class Person {} Class GraduateStudent extends Person {reference takesCourse [*] : GraduateCourse} Class Student intersect Person {reference takesCourse [*] : Course} Class UndergradStudent extends Student {} Class Course{} Class GraduateCourse extends Course{} Class CsCourse extends Course{} My question is why Q1 ⊑ Q2 does not hold? In particular, if I understand correctly, Q1 select undergraduate

RDF4j ParsedQuery or TupleExpr to String Represenation

半腔热情 提交于 2019-12-11 07:23:57
问题 I have a SPARQL query and I want to replace some of the URIs it contains based on a dictionary. I constructed a AbstractQueryModelVisitor that does that, i.e., it substitutes the URIs I want. But once they are substituted, I'm not sure how to get back the string representation of the SPARQL query. I only have the ParsedQuery or TupleExpr of it. Is it possible to convert these representations back to a String representation? Thank you 回答1: There is a SPARQLQueryRenderer class which can convert

comparing labels in a federated query

空扰寡人 提交于 2019-12-11 07:08:10
问题 I have an instance of Wikibase running. I'm able to run federated queries with Wikidata successfully. I have certain queries that compare labels like this: PREFIX xwdt: <http://www.wikidata.org/prop/direct/> PREFIX xwd: <http://www.wikidata.org/entity/> PREFIX xpq: <http://www.wikidata.org/prop/qualifier/> PREFIX xps: <http://www.wikidata.org/prop/statement/> PREFIX xp: <http://www.wikidata.org/prop/> select ?item ?wditem ?itemLabel ?wid ?wditemlabel where { ?item wdt:P17 wd:Q39. ?item wdt

Filter skyscrapers higher than 500 meters in Wikidata

我们两清 提交于 2019-12-11 07:02:55
问题 I try to construct a SPARQL query, where I get a list of skyscrapers with a height of more then 500 meters. I realized, that the property height (P2048) is measured in different units (meter, foot, centimeter). This would not be a problem for me to calculate the different units into meters. But my problem is to figure out, that unit is used for the property height. So my question: how can I get the unit for the property height? My query so far, where ?unit is just empty: SELECT ?skyscraper