sparql

Troubleshooting SPARQL rCurl queries in R

旧城冷巷雨未停 提交于 2021-02-20 02:35:27
问题 I'm doing a sparql query against an authenticated endpoint in R using the SPARQL library. The same query/endpoint/user works using the rrdf package. Unfortuantely, once I get the query working, I need to process the data in R and update the graph with the answers, which rrdf can't do. Setting up a few variables first, the below query works using rrdf: sparql.remote(myEndpoint,myQuery,'rowvar',myUsername,myUserpwd) Using SPARQL, this does not work: SPARQL(myEndpoint,myQuery,curl_args=c(

How to clone or copy a Jena-Ontology-Model (OntModel) to apply temporary changes?

浪尽此生 提交于 2021-02-19 03:58:13
问题 I've been searching for a solution for days now and since there is no forum at Apache Jena I had to create an account at stackoverflow to ask. My problem is that I need a temporary (deep) copy of an already loaded ontology, namely an object of OntModelImpl (with some imports but without any attached inference machine). Its purpose is to apply some validation steps on the model which require some SPARQL UPDATE queries to add some automatically generated triples first. These additional triples

How to handle case-insensitive SPARQL data in MarkLogic

流过昼夜 提交于 2021-02-18 22:01:47
问题 I'm trying to understand how best to handle literals in Marklogic SPARQL data which may be in any case. I'd like to be able to do a case insensitive search but I believe that isn't possible with semantic queries. For a simplistic example I want: SELECT * WHERE { ?s ?p "Red"} and SELECT * WHERE { ?s ?p "red"} to return all values whether the object is "Red", "RED", "red" or "rED". My data is from another source which has variable capitalisation rules. At the moment the only thing I can think

How to handle case-insensitive SPARQL data in MarkLogic

雨燕双飞 提交于 2021-02-18 21:58:37
问题 I'm trying to understand how best to handle literals in Marklogic SPARQL data which may be in any case. I'd like to be able to do a case insensitive search but I believe that isn't possible with semantic queries. For a simplistic example I want: SELECT * WHERE { ?s ?p "Red"} and SELECT * WHERE { ?s ?p "red"} to return all values whether the object is "Red", "RED", "red" or "rED". My data is from another source which has variable capitalisation rules. At the moment the only thing I can think

Getting only english property value

元气小坏坏 提交于 2021-02-11 17:37:30
问题 I am trying to get a list countries including the english short names: # get a list countries with the corresponding ISO code PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX wikibase: <http://wikiba.se/ontology#> SELECT ?country ?countryLabel ?shortName (MAX(?pop) as ?population) ?coord ?isocode WHERE { # instance of country ?country wdt:P31 wd:Q3624078. OPTIONAL { ?country rdfs:label

Retrieve linked wikidata entities having a wikipedia page

泄露秘密 提交于 2021-02-10 20:37:50
问题 I want to query wikidata by free text or by category, to return entities who has a corresponding wikipedia page. For each page (or for a selected page) I want to fetch all the linked wikidata entities who have a corresponding wikipedia article. Note that: for each wikipedia page and linked pages, I want to fetch the corresponding Wikidata Id a linked wikidata entity may exist on other wikipedias, not necessarily in the queried language (e.g. a page in French History is available in multiple

Retrieve linked wikidata entities having a wikipedia page

痞子三分冷 提交于 2021-02-10 20:32:05
问题 I want to query wikidata by free text or by category, to return entities who has a corresponding wikipedia page. For each page (or for a selected page) I want to fetch all the linked wikidata entities who have a corresponding wikipedia article. Note that: for each wikipedia page and linked pages, I want to fetch the corresponding Wikidata Id a linked wikidata entity may exist on other wikipedias, not necessarily in the queried language (e.g. a page in French History is available in multiple

How can I use the RDFLIB module in Python to retrieve a value from an OWL file using SparQL?

放肆的年华 提交于 2021-02-10 19:39:06
问题 I am currently trying to write a script in Python that uses the RDFLIB module in order to retrieve a specific value from an OWL file by using SPARQL. The problem I'm facing is that the current version of my script returns no data. I tried to print each row in order for myself to analayse the output, but the output simply reads "Process finished with exit code 0". My final goal is to retrieve a value (in the example, this value will be '96') from the OWL file. The object to which this value is

Matching attribute sets using SPARQL

烈酒焚心 提交于 2021-02-10 18:44:38
问题 This question is about finding matching candidate and path using a triple store with SPARQL endpoint (Fuseki 3.8.0). The matching criteria is that the attribute 's of a candidate must contain all of the requires of a path . In the minimal example data below, the matches should be candi_1 with path_1 and candi_2 with path_2 . @prefix : <http://example.com/app#> . :candi_1 a :candidate ; :attribute "A", "B", "C" . :candi_2 a :candidate ; :attribute "C", "D" . :candi_3 a :candidate ; :attribute

SPARQL - get properties by label

强颜欢笑 提交于 2021-02-08 08:13:20
问题 For my current project I need to extract information from dbpedia. The only information I have is the label of the resource. To give you an example: I have the resource "car". Now I would like to get e.g. the abstract. Is there a way to solve this with SPARQL? 回答1: That other answer doesn't get you results from DBpedia, which is what you said you wanted. It's also not clear whether you want results for resources which label includes your known string, or is your known string. A couple of