sparql

Extracting hierarchy for dbpedia entity using SPARQL

匆匆过客 提交于 2019-12-08 02:53:47
问题 I am trying to extract the hierarchy of Wikipedia category or Yago classification for DBpedia resources using the SPARQL endpoint. For instance, I would like to find out all the possible categories and classes in hierarchical form of entity, say, http://dbpedia.org/resource/Nokia, like Thing → Organization → Company → … → Nokia. 回答1: A simple SPARQL select can retrieve the information that you're interested in, though it won't be arranged hierarchically. You're interested in getting all the

Can I configure Jena Fuseki with inference and TDB?

对着背影说爱祢 提交于 2019-12-08 00:37:06
问题 I want to configure Fuseki with an inference model supported by TDB. I have been able to configure it with a Memory Model, but not with a TDB Model where I could update triples. I am using the following assembler description: @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#

Sparql endpoint for SAIL object

限于喜欢 提交于 2019-12-07 22:09:12
问题 I have created a SAIL object using tinkerpop blueprints to load RDF data into a Graph database. Ive successfully managed to load the data. The Graph database in question does not have a sparql endpoint to run my query mix test driver. Does anyone know if it possible and if so then how to make a sparql endpoint accessible to my test driver java code over an HTTP server? I am aware 4store, BigData and some other stores have their own built in sparql servers for querying. I am wondering if it is

SPARQL which is the path connecting two objects?

我只是一个虾纸丫 提交于 2019-12-07 20:03:31
问题 Hi all I'd like to discover if there is a relation between two nodes and if any the predicates connecting them. Let's say my graph is like following [Uri1] / \ (pred:a) (pred:b) / \ / \ [Uri2] [Uri3] [Uri4] [Uri5] / \ (pred:c) (pred:d) / \ [Uri6] [Uri7] \ (pred:a) \ [Uri8] If the query is looking for the relations between Uri8 and Uri1, the expected result should be [Uri7] = pred:a [Uri2] = pred:d [Uri1] = pred:a Consider that predicates (relations) between nodes may vary and also lengths.

How I can write SPARQL query that uses similarity measures in Java Code

无人久伴 提交于 2019-12-07 18:28:27
问题 I would like to know a simple method to write this SPARQL query in Java Code: select ?input ?string (strlen(?match)/strlen(?string) as ?percent) where { values ?string { "London" "Londn" "London Fog" "Lando" "Land Ho!" "concatenate" "catnap" "hat" "cat" "chat" "chart" "port" "part" } values (?input ?pattern ?replacement) { ("cat" "^x[^cat]*([c]?)[^at]*([a]?)[^t]*([t]?).*$" "$1$2$3") ("Londn" "^x[^Londn]*([L]?)[^ondn]*([o]?)[^ndn]*([n]?)[^dn]*([d]?)[^n]*([n]?).*$" "$1$2$3$4$5") } bind( replace

SPARQL query to construct sub-graph with select paths (paths have different lengths)

时光毁灭记忆、已成空白 提交于 2019-12-07 18:07:03
问题 Is it possible to CONSTRUCT an RDF sub-graph that contains nodes A, B, C, E, F (but no D, G, H) from the following graph (in notation subject-predicate-object for a total of 7 statements) using a single SPARQL query: A-p-B A-q-C A-r-D A-s-E E-t-F A-u-G G-v-H I know how to formulate a SPARQL query that returns { A-p-B, A-q-C } (i.e. two paths consisting of 1 statement each) and one that returns { A-s-E E-t-F } (i.e. one path consisting of 2 statements). But it it possible to fold both into as

dbpedia SPARQL query to get certain value's for a given city

♀尐吖头ヾ 提交于 2019-12-07 17:53:44
问题 I am sure what I want to do is very easy, yet I cannot seem to get the query right. I have records in dataset which have values such as city name e.g. 'New York' and it's corresponding country code e.g 'US'. I also have access to the full country name and country ISO codes. I would like to get the population and abstract value's for these cities off dbpedia, by using a where clause such as: Get population where name = "New York" and isoCountryCode = "US" I've searched for help on this to no

Optimization of SPARQL query. [ Estimated execution time exceeds the limit of 1500 (sec) ]

余生颓废 提交于 2019-12-07 17:52:19
问题 I am trying to run this query on http://dbpedia.org/sparql but I get an error that my query is too expensive. When I run the query trough http://dbpedia.org/snorql/ I get: The estimated execution time 25012730 (sec) exceeds the limit of 1500 (sec) ... When running the query through my python script using SPARQLWrapper I simply get an HTTP 500. I figure I need to do something to optimize my SPARQL query. I need the data for iterating over educational institutions and importing it in to a local

Retrieve the collection of unionOf and intersectionOf for each OWL

不打扰是莪最后的温柔 提交于 2019-12-07 17:40:26
I'm trying to extract intersectionOf and unionOf in an OWL file, where interesctionOf and unionOf consist of collection of classes, someValuesFrom or/and onProperty . I have created a SPARQL query which extracts the "collection" for the intersectionOf , but the problem is that some of the retrieved data are not related to the class. For example, I have class called man . This class has an equivalent class which is intersectionOf of three classes, namely, adult , person , and male .My SPARQL query returns some incorrect result: it returns that the classes adult , person , and male are

How to return SPARQL results in JSON-LD?

喜你入骨 提交于 2019-12-07 14:39:21
问题 What is a good way to return SPARQL query results in JSON-LD, preferably staying close to the standardized JSON format? Can JSON-LD be returned for every query or only for certain query types? An example of a SPARQL query result in JSON format (i.e., without JSON-LD enrichment): { "head": {"vars": ["s", "p", "o" ]}, "results": { "bindings": [ { "s": { "type":"uri", "value":"http://www.w3.org/1999/02/22-rdf-syntax-ns#type" }, "p": { "type":"uri", "value":"http://www.w3.org/1999/02/22-rdf