jena

“Timeout/query hangs” while executing SPARQL query to DBpedia from Jena

狂风中的少年 提交于 2019-12-24 01:14:28
问题 I am having trouble executing SPARQL queries against dbpedia.org using Jena. The queries are of the form: PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX p: <http://dbpedia.org/property/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?album ?name ?dateofrelease WHERE { ?album p:artist <http://dbpedia.org/resource/SomeArtist> . ?album rdf:type <http://dbpedia.org/ontology/Album> . ?album rdf:type <http://schema.org/MusicAlbum> . ?album p:name ?name . ?album <http:/

Fuseki owl reasoner not working with TDB

半世苍凉 提交于 2019-12-23 23:24:31
问题 This is my configuration file # Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0 ## Fuseki Server configuration file. @prefix : <#> . @prefix fuseki: <http://jena.apache.org/fuseki#> . @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#> . [] rdf:type fuseki:Server ; fuseki:services ( <#service1> ) . #

printing InfModel earlier changes printed representation later?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 22:33:32
问题 I'm getting a strange effect in Jena 2.5.5 (on Linux) where I am playing around with the inference API. The following code is a stripped down version. I am creating an initially empty Model and a generic rule reasoner. I add a reflexivity rule for a certain statement. I attach the reasoner to the model to get an InfModel. Then I create the matching statement and add it to the Model. Result: InfModel contains both the statement and its reverse. So far so good, that's what it's supposed to do.

Jena Rule for Validation af a Ontology

人走茶凉 提交于 2019-12-23 20:07:05
问题 I want to validate an ontology and throw an error if anything is incorrect. The most validation I have to do looks like this: I have a class like this: <owl:Class rdf:about="&schema;ExampleClass"> <rdfs:subClassOf rdf:resource="&schema;SuperClass"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="&schema;myProperty"/> <owl:onClass rdf:resource="&schema;OtherClass"/> <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:qualifiedCardinality> </owl

tdbloader on Cygwin: java.lang.NoClassDefFoundError

∥☆過路亽.° 提交于 2019-12-23 17:57:37
问题 I'm trying to use tbdloader on Cygwin (Windows 7 with the latest Java installation). This is the tbdloader documentation: http://jenawiki.hpl.hp.com/wiki/TDB/Commands This is the wrapper script I'm using to call tdbloader on my machine: #!/bin/bash # Cygwin script to import large NT files in TDB. CD /cygdrive/c/mypath/TDB-0.8.10 echo "TDB found. Setting path" export TDBROOT=/cygdrive/c/mypath/TDB-0.8.10 export PATH=$PATH:$TDBROOT/bin CD /cygdrive/c/mypath/ontodata/ echo "Running import..."

RDF reading/parsing errors

回眸只為那壹抹淺笑 提交于 2019-12-23 16:43:45
问题 I have some RDF files which I want to import into a tripplestore(AllegroGraph), but at the first file I get a SAX parser error, stating there is an unrecognized character. After removing the line in question, everything is great. Then I have tried using the W3C RDF validator and Jena on the RDF with the error-line, but all I got was some warnings regarding undefined languages(absolutely nothing about the error-line). Could you please suggest a method(java if possible) to finding errors in RDF

Can't write large owl file with Jena

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 12:19:59
问题 I'm trying to convert data contained in a database table in a set of triples so I'm writing an owl file using Jena java library. I have successfully done it with a small number of table records (100) which corresponds to nearly 20.000 rows in the .owl file and I'm happy with it. To write the owl file I have used the following code ( m is an OntModel object): BufferedWriter out = null; try { out = new BufferedWriter (new FileWriter(FILENAME)); m.write(out); out.close(); }catch(IOException e) {

jena.query.ResultSet and jena.query.QuerySolution: hasNext() returns alway false after SPARQL request

最后都变了- 提交于 2019-12-23 06:12:22
问题 I have a problem with receiving SPARQL response. The problem is .... when I use the following source code, rs.hasNext() always return false even though the response shouldn't be empty. SPARQL Query: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?s ?sl <http://dbpedia.org/property/name> ?o ?ol FROM <http://en.dbpedia.org/20120601/> WHERE { ?s rdfs:label ?sl . ?s <http://dbpedia.org/property/name> ?o . ?o rdfs:label ?ol .

Adding age (integer literals) to Jena RDF triples, and querying on them with SPARQL

前提是你 提交于 2019-12-23 05:29:19
问题 I'm trying to learn the basics of working with Jena and RDF Triples. Also working with an Oracle database, so following their guide I have some sample programs running, such as Example7-18 SPARQL OPTIONAL Query. The example works fine as written. It allows for matching queries such as where {?s <u:parentOf> ?o} where {<u:John> <u:parentOf> <u:Mary>} What I'd like to do is give John, Mary and Jill an age each, so that I can query and filter on age as described in SPARQL By Example: The Cheat

Jena NoClassDefFoundError with Maven

旧城冷巷雨未停 提交于 2019-12-23 05:23:47
问题 I have a Java Maven project that I developed a while ago and that doesn't work anymore. It uses a parent pom together with another Maven project in which I think the Jena version was changed and it also uses an external library that uses Jena. The Maven dependency is: <dependency> <groupId>com.hp.hpl.jena</groupId> <artifactId>jena</artifactId> <version>2.6.4</version> </dependency> When I execute my tests I get the following errors: java.lang.NoClassDefFoundError: Could not initialize class