jena

OWL Ontology Predicate Logic with Jena

微笑、不失礼 提交于 2019-12-21 23:23:33
问题 I'm having trouble expressing the following situation in my Ontology: Suppose I have four people voting and four votes (so there is a one-to-one mapping between vote and voter). People can either vote yes or no. If I know the outcome of three people's votes, I ought to be able to deduce the fourth person's vote. So to reiterate: John, Bob, Mary, and Carol each vote. Since there are four people there are four votes. The outcome of the vote is a tie (2 yes, and 2 no). Later on the reasoner

How to create owl file using JENA?

依然范特西╮ 提交于 2019-12-21 21:22:14
问题 I am stuck in the middle of ontology creation. I want to create an OWL file using Java which is my objective. I have created the hierarchical clusters but now I have to use those clusters in ontology creation. Thanks in advance. I have tried this so far. I got Dickinson's point. Now this is my code and I am getting an Exception as Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute URIrefs can be included in RDF/XML output: Code: 57/REQUIRED_COMPONENT

Logarithm Function in SPARQL Query

Deadly 提交于 2019-12-21 20:07:28
问题 I am trying to create a SPARQL query that performs the logarithm function on the returned results. I have implemented the Jena SPARQL engine in my java program, but have only been able to find these available functions : http://jena.sourceforge.net/ARQ/library-function.html Does anybody know of a way to take the logarithm (preferably the natural log) of a SPARQL return variable? Example query that works: SELECT DISTINCT ((?Transactions_Num) AS ?BusinessValue) WHERE {{?BusinessProcess relation

How to generate all triples that fit a particular node type or/and edge type using SPARQL query?

偶尔善良 提交于 2019-12-20 07:23:10
问题 It is a follow up question to : How to list and count the different types of node and edge entities in the graph data using SPARQL query? So assuming I have the different node entities and edge entities of a given graph, how do I go about listing all triples, given a node-edge-node pattern? And how do I generate ALL node-edge-node patterns given the node and edge entities? Example: If there is a network consisting of papers(nodes), authors(nodes), conferences(nodes), iswrittenby(edge),

errors in transaction in jena tdb?

与世无争的帅哥 提交于 2019-12-20 06:16:44
问题 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

query with FILTER(?document = “uriNode”) returns no results

点点圈 提交于 2019-12-20 06:05:20
问题 I am executing the SPARQL query below with Jena, where uriNode is a String representing a URI , but this query doesn't give me any results. I've already checked the database and this URI does exist there. What's the problem? String queryString2 = "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " + "PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?author WHERE { " + "?document dc:creator ?author." + "FILTER (?document = \"" + uriNode + "\" ). }"; 回答1: AndyS's answer is right,

How do I start a Fuseki server from Jena API Eclipse project?

做~自己de王妃 提交于 2019-12-20 05:58:13
问题 Hi I am new to the Semantic Web domain and Apache Jena enviroments too, which is why I am posting this question. I have a project that makes use of Jena API. And when I run it, it shows output in the console. I did run Fuseki server from cmd line and it ran as a local server and I could do some playing around with queries and all that. My question is, is it possible to run the project on the server through my project that makes use of the API, and if so, why it should be done? I am confused

how to do reasoning in Jena via Sparql Query

大城市里の小女人 提交于 2019-12-20 05:40:24
问题 I'm using Jena and Sparql to query the ontology file. I have class Tag with two subclasses : C++ and Java. class Subject with several subclasses, which stand for particular University subjects: "C++ programming","System programming", "Java programming" etc. ObjectProperty "hasTags" domain:Subject range:Tag. Each class subject has some tag like "Java", "C++" When executing query SELECT ?subject WHERE { ?subject owl:equivalentClass ?restriction . ?restriction owl:onProperty ont:hasTags .

SPARQL: return all intersections fulfilled by specified or equivalent classes

心已入冬 提交于 2019-12-20 05:30:17
问题 If I have classes ABC and CDE defined as intersections of classes A,B,C,D,E as follows: <Class rdf:about="&blah;ABC"> <equivalentClass> <Class> <intersectionOf rdf:parseType="Collection"> <Restriction> <onProperty rdf:resource="&blah;hasMarker"/> <someValuesFrom rdf:resource="&blah;A"/> </Restriction> <Restriction> <onProperty rdf:resource="&blah;hasMarker"/> <someValuesFrom rdf:resource="&blah;B"/> </Restriction> <Restriction> <onProperty rdf:resource="&blah;hasMarker"/> <someValuesFrom rdf

How could I store multiple ontologies in TDB

[亡魂溺海] 提交于 2019-12-20 04:04:50
问题 I am working on a project which need to save multiple ontologies in one TDB. I tried to do it in my own way, but it didn't work. Help me please..If you know how to use TDB , could you post the code applied to my code? String directory = "./111"; Dataset dataset = TDBFactory.createDataset(directory); Model tdb = dataset.getNamedModel("test1"); String source = "file:///e:/Course.rdf"; System.out.println(tdb.toString()); tdb.commit(); tdb.close(); String source2 = "file:///e:/lyx/resouces