sparql

'FILTER NOT EXISTS ' operator is not working with apache jena?

被刻印的时光 ゝ 提交于 2019-12-25 18:19:15
问题 Here my sparql query code is to find Least Common Subsumer and output of query must be 'A'. I am getting blank result here. I think my query is right but seems to be Apache Jena's "filter not exists" is not working. I have also checked with other example. Is there any alternative solution of "filter not exists" or shall i need to modify my java code for that? OWL file structure Thing: | A |_P(p1,p2) |_M(m1,m2) | B Here A,P,M and B are the concepts. p1,p2,m1 and m2 are the instances. M is

empty ResultSet on second query (despite valid results with first)

岁酱吖の 提交于 2019-12-25 18:13:12
问题 public class MainClass { public static void main(String[] args) { MainClass c = new MainClass(); c.getType("m.012x34"); System.out.println("---------------"); MainClass c1 = new MainClass(); c1.getType("m.012x34"); } public String getType(String mid){ String Type = null; try{ InputStream inputStream = null; Resource resource = null; File automake_triples = new File(".\\automake_triples.ttl"); ArrayList<String> products = new ArrayList<String>(); InputStream in = new FileInputStream(automake

filter out certain properties from sparql query result

蹲街弑〆低调 提交于 2019-12-25 17:28:05
问题 I'm trying to filter out certain properties (e.g dbpprop: ones) from the result of a sparql query. I'm querying dbpedia sparql endoint. More precisely what I'd like to do is expressed by the following pseudo code : quantity_of_interest, property, value, property_type = sparqlQuery(query) if property_type == rdf:Property: pass else: return quantity_of_interest, property, value For now, I filter out the properties afterwards in some python code and I use the following sparql query : SELECT

filter out certain properties from sparql query result

ぃ、小莉子 提交于 2019-12-25 17:27:09
问题 I'm trying to filter out certain properties (e.g dbpprop: ones) from the result of a sparql query. I'm querying dbpedia sparql endoint. More precisely what I'd like to do is expressed by the following pseudo code : quantity_of_interest, property, value, property_type = sparqlQuery(query) if property_type == rdf:Property: pass else: return quantity_of_interest, property, value For now, I filter out the properties afterwards in some python code and I use the following sparql query : SELECT

Virtuoso 42000 Error when using dbpedia sparql

大憨熊 提交于 2019-12-25 16:54:57
问题 I wrote a query in DBpedia SPARQL: select distinct ?s where { ?s rdf:type dbo:Writer. ?s rdf:type yago:LivingPeople. ?s dbo:birthDate ?year. FILTER (?year > 1964-01-01). } but it is showing: Virtuoso 42000 Error The estimated execution time 82850 (sec) exceeds the limit of 240 (sec). What is the problem? How can I solve this? 回答1: The error message tells you the problem -- processing the query is expected to take 82850 seconds, but the server is set to only run for 240 seconds. You can solve

What does “^a” mean in this SPARQL query?

走远了吗. 提交于 2019-12-25 16:17:23
问题 I have found this query, but i'm not able what does it do. I don't know what the "^a" means, particularly. select distinct ?type where { dbpedia:Stephen_King a ?type . filter not exists { ?subtype ^a dbpedia:Stephen_King ; rdfs:subClassOf ?type . filter ( ?subtype != ?type ) } } 回答1: It's a SPARQL 1.1 property path which describes a route through a graph between two graph nodes, in your case it denotes the inverse path, i.e. from object to subject, thus, it's equivalent to dbpedia:Stephen

Bind function in SPARQL with Jena API

℡╲_俬逩灬. 提交于 2019-12-25 12:48:08
问题 I use jena for android to send a query to DBpedia. This is my query: protected Vector<List> doInBackground(String... keyword) { VecDBpedia=new Vector(); vecurl= new ArrayList(); int i=0; ResultSet results,re = null ; QueryExecution exec = null ; try{ do{ if(i!=VectorKeyWords.size()) {System.out.println(keyword[i]); String sparqlQuery= "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n" + "PREFIX dbo: <http://dbpedia.org/ontology/>\n" + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf

“method not allowed” in a python function for flask

我与影子孤独终老i 提交于 2019-12-25 11:54:32
问题 I want to save on a .ttl file a type 'person' resource from a javascript function: this is my sparql query: @app.route('/registraAnnotatore/<author>+<mail>', methods=['POST']) def registraAnnotatore(author,mail): sparql = SPARQLWrapper("http://localhost:3030/data/update") mailto = "<mailto:"+mail+">" sparql.setQuery(""" PREFIX aop: <http://vitali.web.cs.unibo.it/AnnOtaria/person/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX schema: <http://schema.org/> INSERT DATA { """+mailto+""" a foaf

SPARQL - select from skos:category - Virtuoso 37000

▼魔方 西西 提交于 2019-12-25 08:39:35
问题 I have problem with SPARQL. I want to select something from category. For example subjects. I make query like this in http://dbpedia.org/snorql. SELECT ?category ?subject WHERE { ?category a skos:Concept . ?category skos:Concept: American_punk_rock_guitarists. ?category dct:subject ?subject . } LIMIT 1000 I have error Virtuoso 37000. I don't understand why. P.S. Is it good book for beginnier in SPARQL - Learning SPARQL, 2nd Edition Querying and Updating with SPARQL 1.1 ? 回答1: You have at

SPARQL: Choose one triple from multiple match? Supplementation

…衆ロ難τιáo~ 提交于 2019-12-25 08:25:53
问题 I have a query for updating my RDF database. The problem is that ?Terminal2 block of query is returning two different ?Terminal2 's (both match the query) and that is making my code useless. I would need to somehow limit it for only one ?Terminal2 - doesn't matter which one. When I put this code to TopBraid, I get only one line in output so the LIMIT is working for the whole code not just for that subquery. Do you have any idea how to make my code working? There were some ideas about using