jena

fuseki config to an in memory with reasoner not working

柔情痞子 提交于 2019-12-11 12:24:15
问题 These settings were working with fuseki 2.0, now i am on fuseki 2.3, but these settings not working any more: [] rdf:type fuseki:Server ; fuseki:services ( <#serviceInMemoryWithReasoner> ) . <#serviceInMemoryWithReasoner> rdf:type fuseki:Service; rdfs:label "testdataset"; fuseki:name "testdataset"; fuseki:serviceQuery "query"; fuseki:serviceUpdate "update"; fuseki:dataset <#datasetServiceInMemoryWithReasoner> ; . <#datasetServiceInMemoryWithReasoner> rdf:type ja:RDFDataset; ja:defaultGraph <

SPARQL update with optional parts

喜你入骨 提交于 2019-12-11 12:07:59
问题 Consider the following SPARQL update: INSERT { ?performance mo:performer ?performer ; # optional mo:singer ?singer ; # optional mo:performance_of [ dc:title ?title ; # mandatory mo:composed_in [ a mo:Composition ; mo:composer ?composer # optional ] ] } WHERE {} If I do not provide values (e.g. in Jena's ParameterizedSparqlString.setIri() for ?performer , ?singer , or ?composer , this update won't insert statements with the corresponding objects, which is as intended. But how can I suppress []

jena.query.ResultSet and jena.query.QuerySolution: empty iterator after SPARQL request

跟風遠走 提交于 2019-12-11 11:38:14
问题 A have a problem with receiving SPARQL response. A problem is method ((ResultSet) response).hasNext() returns false despite response shouldn't be empty. Request is: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX ontology: <http://www.semanticweb.org/kseniia/ontologies/2013/1/untitled-ontology-12#> SELECT ?x WHERE {?x rdfs

Use RDF API (Jena, OpenRDF or Protege) to convert OpenIE outputs

醉酒当歌 提交于 2019-12-11 11:26:23
问题 I was recommended to use one of the APIs (Jena, OpenRDF or Protege) to convert the outputs that I generated from OpenIE4.1 jar file (downloadable from http://knowitall.github.io/openie/). The following is the sample OpenIE4.1 output format: confidence score followed by subject, predicate, object triplet The rail launchers are conceptually similar to the underslung SM-1 0.93 (The rail launchers; are; conceptually similar to the underslung SM-1) I planned to produce triples that follow this

How to read ontology file with owl:imports in JENA?

我的梦境 提交于 2019-12-11 10:57:26
问题 I have an owl file that import some other ontologies from other owl files. I tried to follow JENA API Documentation to deal with it, but could not succeed. What am I missing? The codes I used are above: e-GovSecAOnto.owl imports: <owl:Ontology rdf:about=""> <owl:imports rdf:resource="http://www.ida.liu.se/~iislab/projects/secont/Security.owl"/> <owl:imports rdf:resource="http://www.unifiedcloud.org/2009/2/26/uci.owl"/> <owl:imports rdf:resource="http://wwwsemanticweb.org/ontologies

Jena Model converts my RDF type explicit declaration to implicit and messes with the format

倾然丶 夕夏残阳落幕 提交于 2019-12-11 10:55:50
问题 I have the following code that creates an RDF resource with some set properties and prints it on console. String uri = "http://krweb/"; String name = "Giorgos Georgiou"; String phone = "6976067554"; String age = "27"; String department = "ceid"; String teaches = "java"; Model model = ModelFactory.createOntologyModel(); model.setNsPrefix("krweb", uri); Resource giorgosgeorgiou = model.createResource(uri+name.toLowerCase().replace(" ", ""), model.createResource(uri+"Professor")); Property has

error: cannot find symbol resultset

醉酒当歌 提交于 2019-12-11 09:36:33
问题 I am really stuck at this...I am trying to convert Result Set into string and this is my code : QueryExecution qExec = QueryExecutionFactory.create(s, ds) ; ResultSet rs = qExec.execSelect() ; //String x=rs.toString(); String[] arr = null; while (rs.next()) { String em = (String)rs.getString(0); arr = em.split("\n"); for (int i =0; i < arr.length; i++){ subjectoutput.setText(arr[i]); } } and it gives error: JavaApplication2.java:137: error: incompatible types while (rs.next()) { ^ required:

Is there any usable dependency for virtuoso.jena.driver?

删除回忆录丶 提交于 2019-12-11 08:24:23
问题 What I want to do is passing data from sesame to virtuoso. Here are my codes: public static void sesame2virtuoso(String server, String repo, String graphName) throws IOException, RepositoryException { //connect sesame HTTPRepository repository = new HTTPRepository(server, repo); repository.setUsernameAndPassword(PropertiesUtil.PropValues("user"), PropertiesUtil.PropValues("password")); repository.initialize(); RepositoryConnection connection = repository.getConnection(); ValueFactory factory

Handle more than one OWL files in a same JENA application

眉间皱痕 提交于 2019-12-11 07:55:52
问题 I am making an application which may require about 2-3 OWL files to work with, in order to serve different task for the same application. I am using Jena as my semantic web framework. My question is: How do we organize/setup these owl files? Should I read all the owl files in the same dataset or I should maintain different datasets for different owls. Note: I am not considering the Imported owls as it is handled by jena itself. If I use same dataset, how can I differentiate to between he

Difference in performance between using VALUES keyword and using directly the URI in the query?

血红的双手。 提交于 2019-12-11 07:49:35
问题 I have a fairly complex SPARQL query with the structure outlined below, involving multiple graph patterns, UNION and nested FILTER NOT EXISTS . I want the query to remain generic, and I want to be able to inject values for certain variables at execution time, and my idea is to append a VALUES keyword at the end of the query to specify the value of certain variables in the query. In the structure below, I set the value of ?x , and I illustrate all the places in the query where ?x applies.