jena

errors in transaction in jena tdb?

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to write propreties into a model and then query it.This part of mycode: String directory = "EMAILADDRESS" ; //create the dataset for the tdb store Dataset ds = TDBFactory.createDataset(directory) ; //create default rdf model ds.begin(ReadWrite.WRITE); Model model = ds.getDefaultModel() ; //write to the tdb dataset When I write this and then query the query shows no result ...but when I interchange the order of model and begin i.e. Model model = ds.getDefaultModel() ; //write to the tdb dataset ds.begin(ReadWrite.WRITE); Then it

writing Jena built-ins

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to write a Jena built-in to return a value from an algorithm I have been given and then do a comparison against that value, e.g., String rule = "[exRule: (?d rdf:type ex:abc)" + "<-" + // ...extract ?a, ?b to use as inputs to the rule "greaterThan(myBuiltIn(?a, ?b), 1)" + // Is return value greater than 1 "]"; So, first the Jena documentation says that the easiest way to experiment with this is to look at the examples in the builtins directory, however I don't seem to have this in my installation, I'm using Jena 2.6.4 on Windows 7

Triple Stores vs Relational Databases [closed]

社会主义新天地 提交于 2019-12-03 02:16:32
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . I was wondering what are the advantages of using Triple Stores over a relational database? 回答1: The viewpoint of the CTO of a company that extensively uses RDF Triplestores commercially: Schema flexibility - it's possible to do the equivalent of a schema change to an RDF

Jena for java 1.7

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there any version compatible with java 1.7v in Jena I'm getting following error and i think it is because of incompatibility Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/jena/query/QueryFactory : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader

apache jena ObjectFileStorage and TupleLib error handling

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: When trying out Apache Jena with the following code: dataset = TDBFactory . createDataset ( directory ); Model model = dataset . getDefaultModel (); dataset . begin ( ReadWrite . WRITE ); Resource r = model . createResource ( NS + "subject" ); Property p = model . createProperty ( NS + "predicate" ); r . addProperty ( p , "object" ); model . write ( System . out , "Turtle" ); dataset . close (); Jena chokes on this. I am in the process of fixing this and purposely not showing what the content was but I am much more concerned with

Jena TDB java.lang.ExceptionInInitializerError

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm using Jena TDB for loading an RDF dataset and making SPARQL queries against it. I'm using the following maven dependency: org . apache . jena apache - jena - libs pom 3 . 0.1 And here's the java code where I'm trying to create a TDB dataset: public void loadDirectory ( String outputFile ){ Dataset dataset = TDBFactory . createDataset ( directoryPath ); Model tdb = dataset . getDefaultModel (); FileManager . get (). readModel ( tdb , outputFile ); tdb . close (); dataset . close (); LOG . info ( "RDF dataset loaded to memory" );

jena api get range of ObjectProperty

匿名 (未验证) 提交于 2019-12-03 01:09:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've and OWL file and I can explore it and navigate through classes and properties but I can't retrieve correct range of ObjectProperty. This is part of my OWL file: <owl:ObjectProperty rdf:about = "&aat;aat2209_located_in" > <rdfs:label xml:lang = "en" > located in </rdfs:label> <rdfs:label xml:lang = "it" > si trova in </rdfs:label> <rdfs:comment xml:lang = "en" > The property defines a relationship between places or places and things </rdfs:comment> <rdfs:comment xml:lang = "it" > La proprietà definisce la relazione tra luoghi o

Load DBpedia locally using Jena TDB?

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to perform a query against DBpedia: SELECT DISTINCT ?poi ?lat ?long ?photos ?template ?type ?label WHERE { ?poi ?label . ?poi ?lat . ?poi ?long . ?poi ?photos . OPTIONAL {?poi ?template } . OPTIONAL {?poi ?type } . FILTER ( ?lat > x && ?lat z && ?long I'm guessing this information is scattered among different dumps (.nt) files and somehow the SPARQL endpoint serves us with a result set. I need to download these different .nt files locally (not all DBpedia), perform only once my query and store the results locally (I don't want to use

Writing to Ontotext GraphDB using Jena

匿名 (未验证) 提交于 2019-12-03 00:59:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use Jena to write to a local free standalone GraphDB (version 8.5.0) repository. What I have tried (1) Direct use from Jena I used this Jena 3.7.0 code snippet: String strInsert = "INSERT DATA {" + "<http://dbpedia.org/resource/Grace_Hopper> " + "<http://dbpedia.org/ontology/birthDate>" + " \"1906-12-9\"^^<http://www.w3.org/2001/XMLSchema#date> .}"; UpdateRequest updateRequest = UpdateFactory.create(strInsert); UpdateProcessor updateProcessor = UpdateExecutionFactory.createRemote(updateRequest, "http://localhost:7200

搭建Jena Fuseki并执行SPARQL查询

匿名 (未验证) 提交于 2019-12-02 23:49:02
windows解压后双击fuseki-server.bat linux解压后运行命令 java -jar fuseki-server.jar --update --loc /data/apache-jena-fuseki-3.5.0/run/databases/DB /ds 程序启动后默认在3030端口运行, http://localhost:3030 新建test.rdf,复制以下内容 <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#"> <rdf:Description rdf:about="http://somewhere/MattJones/"> <vCard:FN>Matt Jones</vCard:FN> <vCard:N rdf:parseType="Resource"> <vCard:Family>Jones</vCard:Family> <vCard:Given>Matthew</vCard:Given> </vCard:N> </rdf:Description> <rdf:Description rdf:about="http:/