sparql

Search Multiple Queries from List in SPARQL

霸气de小男生 提交于 2019-12-08 19:01:27
I want to find sales data for a set of 300 addresses using the UK Land Registry database. The database permits SPARQL queries, however I am completely new to SPARQL, and do not know how to make multiple queries at once (e.g. search for 300 addresses in one SPARQL query). This is an example land registry query for a single address. So I have two questions: 1) How can I search for multiple addresses in one query? 2) Is there a way to connect a database list of addresses to automate the query? Help and direction will be hugely appreciated. In the example query, the first five triple patterns in

Sparql Keys vs distinct values

你。 提交于 2019-12-08 18:46:52
问题 I have a sparql query that returns duplicates, and I want it to clean them up on one of the values only (subjectID). Unlike DISTINCT that seems to find a unique value for the combination of values selected, rather than for only one of the parameters. I saw someone here propose group by, but that only seems applicable if I list all the parameters after group by (my sparql endpoint complains, e.g. Non-group key variable in SELECT: ?occupation). I tried running an internal select, but it doesn't

SPARQL equivalence for the SQL IN() operator

好久不见. 提交于 2019-12-08 17:02:23
问题 Is there a SPARQL equivalence for the SQL IN() operator? I filter my results and now use: FILTER ( lang(?label) = 'en' ) I want something like: FILTER ( lang(?label) IN ('en', 'de') ) Is this possible with SPARQL? 回答1: In SPARQL 1.1 yes. FILTER ( lang(?label) IN ('en', 'de') ) should work. Pre-1.1 you'll need a big disjunction: FILTER ( (lang(?label) = 'en') || (lang(?label) = 'de') ) 回答2: As per official W3C documentation, IN boolean rdfTerm IN (expression, ...) The IN operator tests whether

SPARQL filter regex and union

倾然丶 夕夏残阳落幕 提交于 2019-12-08 12:35:33
问题 My ontology has 2 classes: food foodSource . I want to get the data for the class food with 2 kinds of foodSource using the SPARQL query: SELECT ?food ?foodSource ?foodSource2 WHERE { { ?foodSource mpasi:data_memerlukanBahan ?memerlukanBahan. ?food ?memerlukanBahan ?value. FILTER regex(str(?foodSource),"carrot") } UNION { ?foodSource2 mpasi:data_memerlukanBahan ?memerlukanBahan. ?food ?memerlukanBahan ?value. FILTER regex(str(?foodSource2),"tomato") } } order by ?food I get the correct result

do I use netbeans or Sparql in protege?

旧街凉风 提交于 2019-12-08 12:20:34
问题 I have a question in my project. I do not know whether I need to work netbeans or not. My work is about library book of recommendation systems . that as input I need book Classification ontology . in my ontology classify library books. this classification has 14 categories, beside the sibling classes Author, book, Isbn. Individuals in book class are book’s subject(about 600 subjects) , and individuals in author class are name’s author and also isbn class. also I collected and Have got in part

rdf using apache jena on net beans

£可爱£侵袭症+ 提交于 2019-12-08 11:40:38
问题 I want to create a simple RDF graph and then try simple querying using SPARQL. Since I'm familiar with java and net beans, I want to use Apache Jena on NetBeans. I downloaded the related files from http://www.apache.org/dist/jena/ . What should I do next to write RDF codes on net beans? i.e Should I install something or add lib files/jar files somewhere? 回答1: (Too long for a comment on Ian's reply) Maven is easy on netbeans, and a good way to get started with everything you need (as Ian says)

Unexpected NullPointerException while accessing results of a query [duplicate]

偶尔善良 提交于 2019-12-08 11:03:37
问题 This question already has an answer here : DBpedia Jena Query returning null (1 answer) Closed 6 years ago . I have this code and I don't understand why I'm getting a NullPointerException: public static ArrayList<String> retrieveObject(String istance,String property){ String sparqlQueryString= "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf- syntax-ns#> "+ "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "+ "PREFIX dbpedia: <http://dbpedia.org/resource/> "+ "PREFIX o: <http://dbpedia.org

add RDFS inference rules support in endpoint SPARQL

痴心易碎 提交于 2019-12-08 10:56:28
问题 I have create an endpoint SPAQL on OpenLink Virtuoso. All work well, but i have to access on the data in a Container, in particular a rdf:Seq. I have a Seq like this: <myrdf:has_stoptimes> <rdf:Seq rdf:about="http://test.com/343"> <rdf:li> <myrdf:StopTime rdf:about="http://test.com/StopTime/434"> ... </ns0:StopTime> </rdf:li> <rdf:li> <myrdf:StopTime rdf:about="http://test.com/StopTime/435"> ... </ns0:StopTime> </rdf:li> </rdf:Seq> Now i see that to access data in a container i can use rdfs

How to form SPARQL queries that refers to multiple resources

▼魔方 西西 提交于 2019-12-08 09:27:09
问题 My question is a followup with my first question about SPARQL here. My SPARQL query results for Mountain objects are here. From those results I picked a certain object resource. Now I want to get values of " is dbpedia-owl:highestPlace of " records for this chosen Mountain object. That is, names of mountain ranges for which this mountain is highest place of . This is, as I figure, complex. Not only because I do not know the required syntax, but also I get two objects here. One of them is Mont

Error while querying DBPedia using Apache Jena

余生颓废 提交于 2019-12-08 09:06:43
问题 import java.sql.ResultSet; import java.sql.SQLException; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSetFormatter; public class sparq { public static void main (String[] args) throws SQLException { String queryString= "PREFIX dbpedia: <http://dbpedia.org/resource/>"+ "PREFIX category: <http://dbpedia.org/resource