jena

Unable to resolve NoClassDefFoundError for Jena IRIFactory

走远了吗. 提交于 2019-12-08 04:11:14
问题 Below is the stacktrace of the error log I'm getting. If someone can tell what exactly could be causing this because as per the stacktrace I've everything in place. Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/iri/IRIFactory at net.rootdev.javardfa.uri.IRIResolver.<init>(IRIResolver.java:26) at org.odftoolkit.odfdom.pkg.rdfa.SAXRDFaParser.createInstance(SAXRDFaParser.java:57) at org.odftoolkit.odfdom.pkg.OdfFileDom.initialize(OdfFileDom.java:217) at org

Query Jena TDB store

两盒软妹~` 提交于 2019-12-08 03:36:41
问题 I'm trying to query jena TDB in java. My code follows. It seems that my TDB dataset is empty because model.size() (where model is the dataset default model) return 0. I'm sure it isn't empty, though, because I can query it with Fuseki with my sparqlEndpoint. String directory = "//var//www//fuseki//TDB" ; Dataset dataset = TDBFactory.createDataset(directory) ; Model model = dataset.getDefaultModel(); String sparqlQueryString = "SELECT (count(*) AS ?count) { ?s ?p ?o }" ; Query query =

Can I configure Jena Fuseki with inference and TDB?

对着背影说爱祢 提交于 2019-12-08 00:37:06
问题 I want to configure Fuseki with an inference model supported by TDB. I have been able to configure it with a Memory Model, but not with a TDB Model where I could update triples. I am using the following assembler description: @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . @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#

Explain inference in Jena

醉酒当歌 提交于 2019-12-07 22:01:01
问题 In Jena, I have created an RDFS inference model using InfModel class: InfModel infmodel = ModelFactory.createRDFSModel(schema, data); Given an inferred statement from infmodel, how do we get the two statements that were used to infer it, similar to the the "explain inference" option in Protégé? For instance, if infModel contains the statement :a rdf:type :t , we might get two statements used to infer it, e.g., :a :p :b and :p rdfs:domain :t . 回答1: According to the documentation (and testing

How I can write SPARQL query that uses similarity measures in Java Code

无人久伴 提交于 2019-12-07 18:28:27
问题 I would like to know a simple method to write this SPARQL query in Java Code: select ?input ?string (strlen(?match)/strlen(?string) as ?percent) where { values ?string { "London" "Londn" "London Fog" "Lando" "Land Ho!" "concatenate" "catnap" "hat" "cat" "chat" "chart" "port" "part" } values (?input ?pattern ?replacement) { ("cat" "^x[^cat]*([c]?)[^at]*([a]?)[^t]*([t]?).*$" "$1$2$3") ("Londn" "^x[^Londn]*([L]?)[^ondn]*([o]?)[^ndn]*([n]?)[^dn]*([d]?)[^n]*([n]?).*$" "$1$2$3$4$5") } bind( replace

Retrieve the collection of unionOf and intersectionOf for each OWL

不打扰是莪最后的温柔 提交于 2019-12-07 17:40:26
I'm trying to extract intersectionOf and unionOf in an OWL file, where interesctionOf and unionOf consist of collection of classes, someValuesFrom or/and onProperty . I have created a SPARQL query which extracts the "collection" for the intersectionOf , but the problem is that some of the retrieved data are not related to the class. For example, I have class called man . This class has an equivalent class which is intersectionOf of three classes, namely, adult , person , and male .My SPARQL query returns some incorrect result: it returns that the classes adult , person , and male are

OutOfMemoryError using Pellet as Reasoner

六眼飞鱼酱① 提交于 2019-12-07 14:18:17
问题 I'm trying to infer data using Pellet, but my application always crashes during reasoning due to an "OutOfMemoryError: Java heap space". As suggested elsewhere I have already tried to increase heap size and currently I am using these VM arguments: "-XX:MaxPermSize=256m -Xmx6144m". Furthermore I've to set 'PelletOptions.USE_CONTINUOUS = true', but so far I was only able delays the crashs for some minutes. (Longest run so far: 30 min.). I am storing data in a Jena TDB triplestore. Its total

Using Jena reasoner on Neo4J db

不打扰是莪最后的温柔 提交于 2019-12-07 12:50:11
问题 it's my first time writing here but i'm really struck with a problem: is it possible to use the Jena reasoner on a No-SQL database, like Neo4J, already filled with data? I've a Neo4J's graph rappresenting a bunch of triples and I would like to use the Jena API and the Jena reasoner on them. I thought about using the SDB/TDB component of Jena but I don't get how to actually load the data into my model since the SDB component seems to work with just SQL databases and the go throught the whole

Fuseki GC overhead limit exceeded during data import

吃可爱长大的小学妹 提交于 2019-12-07 06:25:57
问题 I'm trying to import LinkedMDB (6.1m triples) into my local version of jena-fuseki at startup: /path/to/fuseki-server --file=/path/to/linkedmdb.nt /ds and that runs for a minute, then dies with the following error: Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded at com.hp.hpl.jena.graph.Node$3.construct(Node.java:318) at com.hp.hpl.jena.graph.Node.create(Node.java:344) at com.hp.hpl.jena.graph.NodeFactory.createURI(NodeFactory.java:48) at org.apache.jena.riot

Single quad + most basic SPARQL query = 1 result in Jena, 2 results in Sesame - who is right?

≡放荡痞女 提交于 2019-12-07 05:30:27
问题 Add just this one quad to an empty store: <http://x.com/s> <http://x.com/p> 2 <http://x.com/g> . Then execute this SPARQL query (taken from per Bob DuCharme's book 'Learning SPARQL', so this must be standard SPARQL for retrieving all quads across the dataset, regardless of implementation, right!?): SELECT ?g ?s ?p ?o WHERE { { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } } } But Jena and Sesame reply with different answers!!? Here's what I see: Jena Fuseki console on Tomcat 6.0.37 (version 2.10.0