jena

apache jena ObjectFileStorage and TupleLib error handling

依然范特西╮ 提交于 2020-01-07 05:06:09
问题 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 the way

jena api get range of ObjectProperty

我的梦境 提交于 2020-01-06 15:24:06
问题 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

Construct RDF graph on federated query?

雨燕双飞 提交于 2020-01-06 07:27:27
问题 I'm new to SPARQL and RDF. Bascially I have to design federated SPARQL 1.1 query over Wikidata and Dbpedia. Here's my simple query. This will select the films starring Leonardo Di Caprio. PREFIX wd: <http://www.wikidata.org/entity/> PREFIX wdt: <http://www.wikidata.org/prop/direct/> PREFIX dbo: <http://dbpedia.org/ontology/> PREFIX dbr: <http://dbpedia.org/resource/> PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?film WHERE { { SELECT ?film WHERE { ?film wdt:P161 wd:Q38111.

How do I interact with Apache Jena locally? - MacOS

时间秒杀一切 提交于 2020-01-06 07:18:09
问题 I may just be going at this wrong, but I am not sure how to interact with Apache Jena on my computer. I think my main question revolves around where I store files and how I run them. I use Atom editor and work in Python and Javascript normally. My goal here is to get a handle of how Jena and Fuseki work then potentially using Fuseki for the backend of a web app. The tutorial, An Introduction to RDF and the Jena RDF API, links to Java files. Where do I store this file on my desktop and how can

How to include multiple URI's for same property in Jena Model?

你离开我真会死。 提交于 2020-01-06 05:30:06
问题 Hi is there a more efficient way to create the following: .addProperty(RDF.type, locah+"/Repository") .addProperty(RDF.type, DCTerms.Agent) .addProperty(RDF.type, FOAF.Agent); What are the advantages of having a resource with multiple RDF.types? 回答1: Multiple RDF types In computational ontologies, an instance can have multiple classes (types). Classification This can be confusing at first, because for example in medical classification this is different. There you have to choose exactly one

Ho to achieve Mapping between namespaces in Apache Jena thru Reasoning?

久未见 提交于 2020-01-04 11:13:07
问题 Goal: I wan´t to achieve a rule based Mapping between ontologies in order to fulfill a common task of data migration. Way to achieve the goal: To achieve this i developed a abstract data structure which is capable to store all information provided by the xml representation of any datatype. Then i wrote a parser, which constructs a ontology out of targeted document-type definition. Now when i read the data in it is first associated to the abstractDatatype namespace, lets call it aS . The

Ho to achieve Mapping between namespaces in Apache Jena thru Reasoning?

删除回忆录丶 提交于 2020-01-04 11:12:48
问题 Goal: I wan´t to achieve a rule based Mapping between ontologies in order to fulfill a common task of data migration. Way to achieve the goal: To achieve this i developed a abstract data structure which is capable to store all information provided by the xml representation of any datatype. Then i wrote a parser, which constructs a ontology out of targeted document-type definition. Now when i read the data in it is first associated to the abstractDatatype namespace, lets call it aS . The

Iterate over specific resource in RDF file with Jena

巧了我就是萌 提交于 2020-01-04 06:08:20
问题 I'm using Apache Jena to read a RDF file, which looks like this: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:dct="http://purl.org/dc/terms/" xmlns:dctypes="http://purl.org/dc/dcmitype/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <dcat:Catalog rdf:about="http://uri/"> <dcat:dataset> <dcat

Jena library is not writing output to an external RDF/XML file

╄→гoц情女王★ 提交于 2020-01-04 05:24:23
问题 I am having an issue with my jena library's writing method. I have following piece of code which is supposed to write the output in external file but it is not doing so. import com.hp.hpl.jena.rdf.model.*; import com.hp.hpl.jena.vocabulary.*; import com.hp.hpl.jena.rdf.model.impl.ModelCom; public class Tutorial04 extends Object { // some definitions static String tutorialURI = "http://hostname/rdf/tutorial/"; static String briansName = "Brian McBride"; static String briansEmail1 = "brian

Datatype format exception for xsd:dateTime in SPARQL query with Jena?

你离开我真会死。 提交于 2020-01-04 01:58:17
问题 I am trying to apply a range query on a property of the RDF which is of xsd:dateTime format. This is my query: PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?x WHERE { ?y <DATE:> ?x . FILTER(?x>"2014-06-05T10:10:10+0530"^^xsd:dateTime) } It gives warning and nothing as result: WARN [main] (Log.java:78) - Datatype format exception: "2014-06-11T12:44:22+0530"^^xsd:dateTime I don't understand what the problem is? I have stored the property in xsd:dateTime format only. 回答1: I have stored