sparql

Is it possible to combine those 2 SPARQL INSERT into one?

依然范特西╮ 提交于 2019-12-11 06:58:28
问题 I want to perform the following queries, to add a relation skos:related between node a and node b : PREFIX skos:<http://www.w3.org/2004/02/skos/core#> INSERT { GRAPH ?graph { ?a skos:related ?b } } WHERE{ GRAPH ?graph { { ?a skos:inScheme ?scheme } . { ?b skos:inScheme ?scheme } } }; INSERT { GRAPH ?graph { ?b skos:related ?a } } WHERE{ GRAPH ?graph { { ?a skos:inScheme ?scheme } . { ?b skos:inScheme ?scheme } } }; I would prefer to send a single query to the RDF store, but can't find a way

how to get individual(s) for given class/individual with given object property using SPARQL

天涯浪子 提交于 2019-12-11 06:45:26
问题 I have simple ontology called "campus.owl".There is a class called"Lecturer" and which has two sub classes ,RegularLecturer and VisitingLecturer.There is a another class called "Student" which is a sibling class of Lecturer class. I have created individuals for all the classes. Student class is joind with Lecture class with "has" object property. problem I want to get some Lecturer/VisitingLecturer individuals for given student individual. Could you please help me to get this result! Thanks

Same Sparql with different result using different programs

心已入冬 提交于 2019-12-11 06:36:00
问题 I'm using TopBraid as IDE and Jena in Java. For the same SPARQL query and same file, I'm getting two different result sets. The ontology can be found here, https://dl.dropboxusercontent.com/u/108022472/ontology.owl The SPARQL is: select ?individual ?type ?label where { ?individual rdf:type ?type . ?individual rdfs:label ?label filter (?type in (wo:Kingdom)) } My Java Code: public class ExeSparql { static String prefix = "PREFIX owl: <http://www.w3.org/2002/07/owl#> " + "PREFIX xsd: <http:/

Unsuccessful team-employs-player property chain

浪尽此生 提交于 2019-12-11 06:35:07
问题 I am intrigued by Using Property Chains to get inferred Knowledge in an OWL Ontology(Protege) The accepted answer has two solutions: two OWL expressions, or a SWRL rule. I get the sense that the OP found the all-OWL (property chain) solution confusing but was satisfied with the SWRL answer. I am trying to implement the all-OWL solution. So far, I don't see an inference that Steven_Gerrard is employed by England when reasoning with Pellet . I do see the inference Steven_Gerrard R

How do I specify options in the SPARQL REST endpoint for MarkLogic?

有些话、适合烂在心里 提交于 2019-12-11 06:33:31
问题 When I query the SPARQL endpoint for marklogic, I am trying to specify the optimize option: /v1/graphs/sparql?options=optimize%3D2 This results in a 400 error: REST-INVALIDPARAM: (err:FOER0000) Invalid parameter: No configured options: optimize=2" What is the correct syntax to specify this and other options? Related: How can I optimize a SPARQL query that returns optional properties? 回答1: See reference for GET /v1/graphs/sparql. There is an "optimize" parameter you can specify. For example:

Handling commas when using a namespace PREFIX in a Sparql WHERE clause

早过忘川 提交于 2019-12-11 06:15:13
问题 I am trying to query the skos:broader property for the DBPedia category "Diseases_of_oral_cavity,_salivary_glands_and_jaws". This category is available at the following URI: http://dbpedia.org/resource/Category:Diseases_of_oral_cavity,_salivary_glands_and_jaws The following query provides the desired output: PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?broaderCategory WHERE { <http://dbpedia.org/resource/Category:Diseases_of_oral_cavity,_salivary_glands_and_jaws> skos:broader

SPARQL-DL: query for literals

拜拜、爱过 提交于 2019-12-11 06:15:04
问题 I'm using SPARQL-DL with OWL-API in a Java application. The Maven dependency is the following: <dependency> <groupId>edu.stanford.protege</groupId> <artifactId>de-derivo-sparqldlapi</artifactId> <version>2.0.0</version> </dependency> I assume it downloads the right (compatible) version of OWL-API. I have a class Person with some individuals. Each individual has a data property called name which ranges over a string. By running this query: SELECT ?x WHERE { PropertyValue(?y, my:name, ?x) } I

Specifying an intersection with multiple values in a SPARQL query

不羁的心 提交于 2019-12-11 05:46:50
问题 I'm trying to build a query that returns events that have two named participants. The names of these participants are specified using values for the first name and last name. So far, this is the only working solution I have been able to come up with: SELECT ?event WHERE { ?event con:hasParticipant ?personA . ?personA con:hasFirstName "Bob"^^xsd:string . ?personA con:hasLastName "Smith"^^xsd:string . ?event con:hasParticipant ?personB . ?personB con:hasFirstName "The"^^xsd:string . ?personB

Query both DBPedia and Wikidata at the same time?

☆樱花仙子☆ 提交于 2019-12-11 05:45:31
问题 Is there a way to query both DBPedia and Wikidata at the same time? Like any way to query all the people in DBPedia and Wikidata at the same time? PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX dbo: <http://dbpedia.org/ontology/> { SELECT ?person WHERE { ?person wdt:P31 wd:Q5 } limit 100 } UNION { SELECT * { ?person a dbo:Person } } Try here 回答1: Thanks to @AKSW I got the answer to my question. The Federated SPARQL queries would do the

How can I match string labels from an external SPARQL endpoint with string labels in my local ontology?

倖福魔咒の 提交于 2019-12-11 05:19:47
问题 PREFIX ex: <http://www.semanticweb.org/caeleanb/ontologies/twittermap#> PREFIX dbo: <http://dbpedia.org/ontology/> SELECT ?name (STR(?name) AS ?strip_name) ?name2 WHERE { ?p ex:displayName ?name2 . SERVICE <http://dbpedia.org/sparql> { { ?s rdfs:label ?name . ?s rdf:type foaf:Person . } UNION { ?x rdfs:label ?name . ?x dbo:wikiPageRedirects ?s . } } FILTER(STR(?name) = ?name2) . } This is the SPARQL query that I am sending to my Stardog SPARQL endpoint (hosted locally). I know a bunch of the