sparql

Extract all parents of a given node

◇◆丶佛笑我妖孽 提交于 2019-12-20 06:28:20
问题 I'm trying to extract all parents of a each given GO Id (a node) using EBI-RDF sparql endpoint, I was based on this two similar questions to formulate the query, here're two examples illustrating the problem: Example 1 (Link to the structure): biological_process (GO:0008150) |__ metabolic process (GO:0008152) |__ methylation (GO:0032259) In this example, using the following query: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SPARQL full aggregation on a group aggregation

 ̄綄美尐妖づ 提交于 2019-12-20 06:25:08
问题 I have an Ontology where users can use one of five predicates to express how much they like an item. The Ontology contains specific predicates that have a property called hasSimilarityValue. I am trying to do the following: Having a user let's say rs:ania Extract all the items that this user has rated before. (this is easy because the Ontology already contains triple from the user to the items) Extract similary items to the items that have been extracted in step 2 and calculate their

errors in transaction in jena tdb?

与世无争的帅哥 提交于 2019-12-20 06:16:44
问题 I am trying to write propreties into a model and then query it.This part of mycode: String directory = "EMAILADDRESS" ; //create the dataset for the tdb store Dataset ds = TDBFactory.createDataset(directory) ; //create default rdf model ds.begin(ReadWrite.WRITE); Model model = ds.getDefaultModel() ; //write to the tdb dataset When I write this and then query the query shows no result ...but when I interchange the order of model and begin i.e. Model model = ds.getDefaultModel() ; //write to

query with FILTER(?document = “uriNode”) returns no results

点点圈 提交于 2019-12-20 06:05:20
问题 I am executing the SPARQL query below with Jena, where uriNode is a String representing a URI , but this query doesn't give me any results. I've already checked the database and this URI does exist there. What's the problem? String queryString2 = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " + "PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?author WHERE { " + "?document dc:creator ?author." + "FILTER (?document = \"" + uriNode + "\" ). }"; 回答1: AndyS's answer is right,

sparql query on wikidata

拟墨画扇 提交于 2019-12-20 05:49:18
问题 i am very new to sparql and i am trying to run 3 queries on wikidata: Persons who are not painters and who are students of painters. Persons who are not painters and who are academic offspring or children of painters (note: an academic offspring of a person P is somebody who is/was a student of P , or a student of a student of P , or .... ). People who are academic offspring of themselves. i got stuck on the first one, i tried: SELECT DISTINCT ?human ?humanLabel WHERE { ?human wdt:P31 wd:Q5.

how to do reasoning in Jena via Sparql Query

大城市里の小女人 提交于 2019-12-20 05:40:24
问题 I'm using Jena and Sparql to query the ontology file. I have class Tag with two subclasses : C++ and Java. class Subject with several subclasses, which stand for particular University subjects: "C++ programming","System programming", "Java programming" etc. ObjectProperty "hasTags" domain:Subject range:Tag. Each class subject has some tag like "Java", "C++" When executing query SELECT ?subject WHERE { ?subject owl:equivalentClass ?restriction . ?restriction owl:onProperty ont:hasTags .

SPARQL: return all intersections fulfilled by specified or equivalent classes

心已入冬 提交于 2019-12-20 05:30:17
问题 If I have classes ABC and CDE defined as intersections of classes A,B,C,D,E as follows: <Class rdf:about="&blah;ABC"> <equivalentClass> <Class> <intersectionOf rdf:parseType="Collection"> <Restriction> <onProperty rdf:resource="&blah;hasMarker"/> <someValuesFrom rdf:resource="&blah;A"/> </Restriction> <Restriction> <onProperty rdf:resource="&blah;hasMarker"/> <someValuesFrom rdf:resource="&blah;B"/> </Restriction> <Restriction> <onProperty rdf:resource="&blah;hasMarker"/> <someValuesFrom rdf

Can GraphDB load 10 million statements with OWL reasoning?

痴心易碎 提交于 2019-12-20 03:13:52
问题 I am struggling to load most of the Drug Ontology OWL files and most of the ChEBI OWL files into GraphDB free v8.3 repository with Optimized OWL Horst reasoning on. is this possible? Should I do something other than "be patient?" Details: I'm using the loadrdf offline bulk loader to populate an AWS r4.16xlarge instance with 488.0 GiB and 64 vCPUs Over the weekend, I played around with different pool buffer sizes and found that most of these files individually load fastest with a pool buffer

Get WikiData Identifier for city by GPS location

蹲街弑〆低调 提交于 2019-12-20 03:09:52
问题 I want to get the city /settlement at a specific gps location. meaning the closest one in a given range or at best the closest. i found some example queries in the wikimedia data examples. I try to adopt then but i get only errors or timeouts here is my current query: SELECT * WHERE { ?city wdt:P31/wdt:P279* wd:Q15642541 . // only settlements # Search by Nearest SERVICE wikibase:around { ?place wdt:P625 ?location . bd:serviceParam wikibase:center "Point(8.4024875340491 48.9993762209831)"^^geo

How do I make a SPARQL query to find the highest value for a property?

十年热恋 提交于 2019-12-19 18:22:25
问题 Lets say I have a predicate like 'age' where the values of all age triples are integer literals. What SPARQL query would return the subject with the highest age in the data? 回答1: You just need to do order by desc with the age predicate and then limit to just get the first one. PREFIX ns: <http://namespace.org/ontology/> SELECT ?s ?age WHERE { ?s ns:age ?age } ORDER BY DESC(?age) LIMIT 1 See the semantics of order by in SPARQL here With the next version of SPARQL , 1.1, that is already