sparql

Why does my SPARQL query return the URI of a resource instead of its name?

爱⌒轻易说出口 提交于 2019-12-17 04:09:47
问题 I want to get all classes of my ontology. This is a part of my ontology file in RDF/XML format created by Protege: <!-- http://www.w3.org/2002/07/owl#aqua --> <Class rdf:about="&owl;aqua"/> <!-- http://www.w3.org/2002/07/owl#varioPerfect --> <Class rdf:about="&owl;varioPerfect"/> I wrote this query, which works properly in Protege, but when I use it in dotNetRDF it returns the full URI of the class instead of just its name. public string[] ontologysearch() { List<string> list = new List

Why does my SPARQL query return the URI of a resource instead of its name?

£可爱£侵袭症+ 提交于 2019-12-17 04:09:17
问题 I want to get all classes of my ontology. This is a part of my ontology file in RDF/XML format created by Protege: <!-- http://www.w3.org/2002/07/owl#aqua --> <Class rdf:about="&owl;aqua"/> <!-- http://www.w3.org/2002/07/owl#varioPerfect --> <Class rdf:about="&owl;varioPerfect"/> I wrote this query, which works properly in Protege, but when I use it in dotNetRDF it returns the full URI of the class instead of just its name. public string[] ontologysearch() { List<string> list = new List

How to include variable in SPARQL query using PHP

落花浮王杯 提交于 2019-12-14 04:22:40
问题 I am creating a query form and let the user to enter the keyword from the form. Then the query form will bring to the next page where I carry the variable created in the query form to the next page. The excerpt code for the new page is as folows: //received variable $abc1=$_POST['querykeyword']; $querystring = ' Prefix try <http://www.semanticweb.org/ontologies/2009/5/test.owl#> SELECT ?name ?age WHERE { ?url try:has-name ${"abc1"} ?name ?url try:has-age ?age }'; However, it did not give the

How to check for a sub-property at all levels expanded from a SPARQL * wildcard?

一世执手 提交于 2019-12-14 03:48:50
问题 In Wikidata, I want to find an item's country. Either directly if the item has a country directly, or by climbing up the P131s (located in the administrative territorial entity) until I find a country. Here is the query: ?item wdt:P131*/wdt:P17 ?country. The query above works fine... except when a sub-division used to belong to another country, like for Q25270 (Prishtina). In such case, the result can be anachronistic. That's what I want to fix. Great news: in such cases we should only

how to use CSPARQL-ReadyToGoPack-0.9 in a SBT project

爱⌒轻易说出口 提交于 2019-12-14 03:31:38
问题 I want to use the CSPARQL-ReadyToGoPack-0.9 in an SBT project. I'm on Linux. How can I do that? 回答1: In your build script you probably need to specify an artifact explicitly for the dependency (the module id parameters are jus): import sbt._ import Keys._ libraryDependencies += "foo" % "bar" % "0.1" artifacts Artifact("foo", url("file:/path/to/jar")) 来源: https://stackoverflow.com/questions/32274826/how-to-use-csparql-readytogopack-0-9-in-a-sbt-project

Get all page titles on Wikipedia that contain a specific word

假如想象 提交于 2019-12-14 03:27:57
问题 I am writing an "auto-wikifier" tool using HTML and JavaScript. For each word in the text to be wikified, I need to obtain a list of pages that contain that word (so that the matching phrases in the text can be automatically wikified, if they are found). Is there a way to obtain a list of all Wikipedia pages that contain a specific word, using one of Wikipedia's APIs or web services? function getMatchingPageTitles(theString){ //get a list of all matching page titles for a specific string,

how to use Union/or in sparql path with arbitrary length?

陌路散爱 提交于 2019-12-14 02:19:46
问题 I'm using below query to find all properties with domain of city (or superclasses of city) or range of country (or superclasses of country) from DBPedia ontology. when I use path with fixed length there is no problem but when I put * to define paths with arbitrary length, I get this error: Virtuoso 37000 Error SP031: SPARQL compiler: Variable '_::trans_subj_6_4' is used in subexpressions of the query but not assigned my SPARQL: define sql:signal-void-variables 1 define input:default-graph-uri

Sparql query delete all statements

喜你入骨 提交于 2019-12-14 02:15:33
问题 I would like to delete all statements related to an object that contains certain characters in the label. I am using the query: DELETE {?term ?p ?o} WHERE { ?term rdfs:label ?label. FILTER(regex(?label, "xx", "i")) ?term ?p ?o. } However, this query seems to fail to delete all the statements that contain the subject of this statement as object. Then I seem to need another query. DELETE {?s ?p ?term} WHERE { ?term rdfs:label ?label. FILTER(regex(?label, "xx", "i")) ?s ?p ?term. } The SELECT *

Desktop SPARQL client for Jena (TDB)?

感情迁移 提交于 2019-12-14 01:54:03
问题 I'm working on an app that uses Jena for storage (with the TDB backend). I'm looking for something like the equivalent of Squirrel, that lets me see what's being stored, run queries etc. This seems like an obvious thing to need, but my (perhaps badly phrased) google queries aren't turning up anything promising. Any suggestions, please? I'm on XP. Even a command line tool would be helpful. 回答1: Take a look at my Store Manager tool which is part of the dotNetRDF Toolkit which I develop as part

Removing unwanted superclass answers in SPARQL

ⅰ亾dé卋堺 提交于 2019-12-14 01:21:17
问题 I have an OWL file that includes a taxonomic hierarchy that I want to write a query where the answer includes each individual and its immediate taxonomic parent. Here's an example (the full query is rather messier). @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdf: <http:://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix : <urn:ex:> . :fido rdf:type :Dog . :Dog rdfs:subClassOf :Mammal . :Mammal rdfs:subClassOf :Vertebrate . :Vertebrate rdfs:subClassOf :Animal . :fido