sparql

Filter by date range in SPARQL

和自甴很熟 提交于 2020-01-22 11:03:06
问题 I am using Jena's SPARQL engine and trying to write a query to filter on a date range as I need to find the value of a property after a fixed date. My date property is in the following format: Fri May 23 10:20:13 IST 2014 How do I write a SPARQL query to get other properties with dates greater than this? 回答1: With your data in that format you can't filter on a range of it without adding a custom extension function to ARQ (which is intended for advanced users) since you would need to parse and

Free text search in sparql when you have multiword and scaping character

♀尐吖头ヾ 提交于 2020-01-16 19:47:09
问题 I am wondering how I can use in sparql query when I have a word like : Robert J. O'Neill I am looking for the resource that have the multiword unit with quota or unicode character in the Label property. SELECT DISTINCT ?resource ?abstract WHERE {?resource rdfs:label ?s. ?s <bif:contains> "'Robert J. O'Neill'" ?resource dbo:abstract ?abstract } ''' 回答1: Here is the query that will return all the elements that have "Robert J. O'Neill" as label. SELECT DISTINCT ?s WHERE { ?s rdfs:label ?label .

Sparql query from Dbpedia and another graph returns less results than expected

吃可爱长大的小学妹 提交于 2020-01-16 18:07:09
问题 I'm a beginner in SPARQL and I'm working on this endpoint http://spcdata.digitpa.gov.it:8899/sparql. I'd like to join data from the DBpedia graph. I'm using the property owl:sameAs for referencing to DBpedia resources. I'd like to fetch the name and population values of all cities falling in the class pa:Comune for which a dbp:populationTotal value is defined. Here is my query: PREFIX pa: <http://spcdata.digitpa.gov.it/> PREFIX rdf: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dbp: <http:/

Sparql query from Dbpedia and another graph returns less results than expected

醉酒当歌 提交于 2020-01-16 18:06:09
问题 I'm a beginner in SPARQL and I'm working on this endpoint http://spcdata.digitpa.gov.it:8899/sparql. I'd like to join data from the DBpedia graph. I'm using the property owl:sameAs for referencing to DBpedia resources. I'd like to fetch the name and population values of all cities falling in the class pa:Comune for which a dbp:populationTotal value is defined. Here is my query: PREFIX pa: <http://spcdata.digitpa.gov.it/> PREFIX rdf: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dbp: <http:/

Delete RDF tuple using dotNetRDF [duplicate]

点点圈 提交于 2020-01-16 09:08:10
问题 This question already has answers here : SPARQL delete query dotNetRDF does not modify RDF file (2 answers) Closed 5 years ago . I'd like to delete a RDF tuple using dotNetRDF. Here is my RDF file: <rdf:RDF xml:base="http://www.example.org/destDetails#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:ns0="http://www.example.org/destDetails#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="&ns0;0165a659

How to get total number of results when using LIMIT in SPARQL?

天大地大妈咪最大 提交于 2020-01-16 09:04:44
问题 I have a SPARQL query which returns result with a LIMIT of 20.. In this query I also want to know the total number of results without running the query two times (one with LIMIT and one without LIMIT ).. For Example-- On running a query total possible results are 500 with LIMIT it displays only 20 at a time, but in my response I want a field which displays total result count, i.e., 500 ... Updated question Suppose Now if i do a query where sequence = abc_11 with LIMIT=2 I will get something

Query city/state/country abstracts in English

随声附和 提交于 2020-01-16 00:58:30
问题 I am trying to query city, state and country abstracts in English from DBpedia with mixed results. It seems to work well with City and Country but not with State. SELECT * WHERE { ?x rdfs:label "France"@en. ?x dbpedia-owl:abstract ?abstract. FILTER (LANG(?abstract) = 'en') } Or SELECT * WHERE { ?x rdfs:label "Boston"@en. ?x dbpedia-owl:abstract ?abstract. FILTER (LANG(?abstract) = 'en') } However, these queries don't find any results: SELECT * WHERE { ?x rdfs:label "Sao Paulo"@en. ?x dbpedia

Search by name in rdf/n3 file

五迷三道 提交于 2020-01-15 10:54:29
问题 I have to perform some filtering in a turtle/n3 file, returning another file of the same kind. The basic data element (location) i work on is this: :pt0001 vcard:category "Poste e Telegrafi" ; vcard:fn "Ufficio Bologna 1" ; vcard:extended-address "Via Cairoli 9, Bologna BO, Italy" ; vcard:latitude "44.504192" ; vcard:longitude "11.338661" ; vcard:tel "051 243425" ; vcard:fax "051 244459" ; cs:opening "Mon, Tue, Wed, Thu, Fri: 0800-1330. Sat: 0800-1230." ; cs:closing "01-01, 01-06, P, LA, 04

sparql group by and order by: not ordered

浪子不回头ぞ 提交于 2020-01-15 10:48:11
问题 I follow up on query where the schema.org database is used to find the number of children of a class - as a simpler database than my application. I want to get the names of the children concatenated in alphabetic order. The query prefix schema: <http://schema.org/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?child (group_concat (?string) as ?strings) where { ?child rdfs:subClassOf schema:Event . ?grandchild rdfs:subClassOf ?child . bind (strafter(str(?grandchild), "http:/

Jena Sparql Error java.lang.Integer

坚强是说给别人听的谎言 提交于 2020-01-15 08:08:22
问题 I have the following code: RestClient client = new RestClient("http://localhost:8080/scheduler.core/rest/services/discoverSensors"); client.AddParam("userID", "keith@acrosslimits.com"); client.AddParam("longitude", "4.3512725830078125"); client.AddParam("latitude", "50.84761359783461"); client.AddParam("radius", "15.0"); client.AddHeader("accept", "application/xml"); try { client.Execute(RestClient.RequestMethod.GET); } catch (Exception e) { e.printStackTrace(); } String response = client