jena

Creating a Lucene index for an existing Apache Jena TDB to implement text search

此生再无相见时 提交于 2019-12-12 05:30:47
问题 I have a large Apache Jena TDB, I want to build a Lucene index using Apache Jena 2.10.2 for use with the new text search feature. I find the documentation hard to follow. I first tried to use configuration in code, but had trouble with the dependencies. Any combination of lecene-core and solr-solrj would either result in certain 'classNotFound' errors or a 'StandardAnalyzer overrides final method tokenStream' error. Example of Code: Dataset ds1 = DatasetFactory.createMem() ; EntityDefinition

URI of an RDF resource in Jena model

ぃ、小莉子 提交于 2019-12-12 05:25:22
问题 While I create resources in the model and print the URI, I get the correct namespace. For instance, the URI is http://www.somesite1.com/rdfdump/resources/resourceid-1 However, when I export the resources to an RDF file (link to the file) and I import it, I get the resource URI pointing to the physical location of the file in the disk such as file:///D:/somefolder/resources/resourceid-1 I am using com.hp.hpl.jena.rdf.model.Model in conjunction with com.hp.hpl.jena.ontology.OntModel . The RDF

405 HTTP method PUT is not supported by this URL

拜拜、爱过 提交于 2019-12-12 03:46:35
问题 I started Fuseki server using this configuration: @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 tdb: <http://jena.hpl.hp.com/2008/tdb#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix sdb: <http://jena.hpl.hp.com/2007/sdb#> . [] rdf:type fuseki:Server ; fuseki:services ( <#memory> <#tdb> #<#mysql> ) . # Custom code. [] ja

Take name and count number of sibling classes in generated ontology using Java

人盡茶涼 提交于 2019-12-12 03:36:14
问题 I first generated the ontology. It was successful. Then, I want to take sibling classes name for each class and count number of sibling classes of each class in the generated ontology.As a example, Main super class- A Two sub classes of A - B , C Three sub classes of B- D, E I tried using following code. I used getSuperClass to get the super class, and then getSubClass to get the subclasses of that. I used arraylist for first take name of each sibling classes. So, in above example output

No output for rule in Jena using generic rule reasoner

[亡魂溺海] 提交于 2019-12-12 02:56:09
问题 I created an ontology in Protege and imported that ontology in Eclipse using Jena. I have written rules in rule file and want the output of the rules to be displayed in Jena but its not showing output. Program is getting executed without errors. The details of ontology are Thing Children 0-12Months 1-3Years 4-7Years 7-12Years Toys Bikes Building_Blocks Dolls Skates Stuffed_toys Added one datatype property playWith domain children and range Toys whose inverse is playedBy Added four inviduals

Writing nested rdf:Description elements in RDF/XML with Jena

随声附和 提交于 2019-12-12 02:49:40
问题 I would like to have a file like this: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://stackoverflow.com/q/24084473/1281433/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:j.0="http://stackoverflow.com/q/24084473/1281433/relations/"> <rdf:Property rdf:about="http://stackoverflow.com/q/24084473/1281433/Regione"> <rdfs:label>Regione</rdfs:label> </rdf:Property> <rdf:Property rdf:about="http://stackoverflow.com/q/24084473/1281433/Nome"> <rdfs:label>Nome<

SPARQL query using rdf:ID returns no results

吃可爱长大的小学妹 提交于 2019-12-12 02:37:39
问题 I have an owl file and I am trying to run queries on it but not getting any results please some one help me to figure it out and explain basic querying public static void main(String[] args) { String filename="H:/Samson_study/nodeTest/hRESTS-TC3/ontology/ApothecaryOntology.owl"; Model model=ModelFactory.createDefaultModel(); OntModel model1=ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM,model); try { File file=new File(filename); FileInputStream reader=new FileInputStream(file);

Why dbpedia result is not consistant

淺唱寂寞╮ 提交于 2019-12-12 02:08:48
问题 I'm executing the below SPARQL query PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?resource WHERE { ?resource a <http://dbpedia.org/ontology/Place> . {?resource rdfs:label 'Paris'@en.} UNION { ?resource rdfs:label 'France'@en.} } I'm executing this here. Sometimes I am getting required result and sometimes it returns 502 error ( I get the message that website is under maintenance.....) Can you please let me know why result is not consistent and how can I avoid this? Also

Comparing two SPARQL queries in Jena

天大地大妈咪最大 提交于 2019-12-12 02:08:23
问题 I want to know whether two SPARQL queries are logically equivalent, for e.g. suppose I have two queries as follows, how can I know if they are equivalent ? String query1= "SELECT ?name where { <http://www.example.com/P500> a <http://www.example.com/Parking>; " + "<http://www.example.com/name> ?name .}"; String query2= "SELECT ?name where { <http://www.example.com/P500> <http://www.example.com/name> ?name;" + " a <http://www.example.com/Parking> .}"; The codes below doesn't perform a logical

Loading resources with FileManager doesn't work in Jena 2.10.1

拥有回忆 提交于 2019-12-11 23:57:16
问题 The following code works in Jena 2.10.0 but fails in Jena 2.10.1: model = FileManager.get().loadModel(uri, base, "RDF/XML"); The stack trace is: com.hp.hpl.jena.n3.turtle.ParserTurtle.parse(ParserTurtle.java:67), com.hp.hpl.jena.n3.turtle.TurtleReader.readWorker(TurtleReader.java:33), com.hp.hpl.jena.n3.JenaReaderBase.readImpl(JenaReaderBase.java:116), com.hp.hpl.jena.n3.JenaReaderBase.read(JenaReaderBase.java:81), com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:274), com.hp.hpl