jena

Sparql query doesn't upadate when insert some data through java code

徘徊边缘 提交于 2019-12-01 00:45:17
I'm trying to insert data through my java code to the owl file which is loaded into Fuseki server. Update query doesn't give any error message. But owl file doesn't update.I'm using jena library and implemented using java code. What is the wrong in my code? public boolean addLecturerTriples(String fName, String lName, String id, String module) { try{ ArrayList<String> subject = new ArrayList<String>(); ArrayList<String> predicate = new ArrayList<String>(); ArrayList<String> object = new ArrayList<String>(); subject.add("<http://people.brunel.ac.uk/~csstnns/university.owl#"+fName+">");

Semantic web application - using BBC Sports ontology

本秂侑毒 提交于 2019-12-01 00:36:31
I am trying to make a semantic web application about running races in my area (10k, half marathons, marathons). More specifically I want to collect and publish (in RDF) data about races, participants and results, and merge similar data. The last few weeks I have been testing Jena (including TDB), doing some web scraping from static web sites about running races and reading about vocabularies and ontologies. I think the most reputable ontology to use for my application, and also the one with the lowest barrier to entry (not very over-engineered), is the BBC sports ontology. http://www.bbc.co.uk

Semantic web application - using BBC Sports ontology

扶醉桌前 提交于 2019-11-30 19:08:54
问题 I am trying to make a semantic web application about running races in my area (10k, half marathons, marathons). More specifically I want to collect and publish (in RDF) data about races, participants and results, and merge similar data. The last few weeks I have been testing Jena (including TDB), doing some web scraping from static web sites about running races and reading about vocabularies and ontologies. I think the most reputable ontology to use for my application, and also the one with

Is there a Java open source implementation of R2RML?

ぐ巨炮叔叔 提交于 2019-11-30 19:05:49
I want to generate RDF data from tabular data, in particular: CSV, TSV, spreadsheets (either Excel or OpenOffice) and, eventually, tables in RDBMS. I am aware of the "RDB to RDF Mapping Language" (R2RML) (http://www.w3.org/TR/r2rml/) current draft. I use Apache Jena for processing, storing and querying RDF data and/or reading CSV or TSV files. I use Apache POI for reading Microsoft Excel spreadsheets and I am planning to use Apache ODF Toolkit for reading OpenOffice spreadsheets. Is there a Java open source (preferably ASL) implementation of R2RML I can use? D2RQ is the underling

Sparql query doesn't upadate when insert some data through java code

六月ゝ 毕业季﹏ 提交于 2019-11-30 18:49:45
问题 I'm trying to insert data through my java code to the owl file which is loaded into Fuseki server. Update query doesn't give any error message. But owl file doesn't update.I'm using jena library and implemented using java code. What is the wrong in my code? public boolean addLecturerTriples(String fName, String lName, String id, String module) { try{ ArrayList<String> subject = new ArrayList<String>(); ArrayList<String> predicate = new ArrayList<String>(); ArrayList<String> object = new

Fuseki indexed (Lucene) text search returns no results

 ̄綄美尐妖づ 提交于 2019-11-30 18:24:35
问题 I have a very large ontology RDF file (almost 4M instances) that I'm currently streaming via Fuseki v2.0.0. My assembler file looks like this: @prefix : <#> . @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 text: <http://jena.apache.org/text#> . @prefix myprefix: <http://www.example.org/some/path/myprefix#> . #

How to add qualified cardinality in JENA

与世无争的帅哥 提交于 2019-11-30 15:49:07
问题 How can I add qualified cardinality restriction in Jena? I can not use createCardinalityQRestriction because the OntModelSpec is for the first version of OWL, not OWL2. In ModelFactory's createOntologyModel, is there a way to create an OWL2 ontology? I need a class expression like JeVysledkom exactly 1 Kolik_Fazovy I've tried using this code: OntModel ontModel = ModelFactory.createOntologyModel(); OntClass ret = ontModel.createCardinalityQRestriction(null, ontProperty, cardinality, ontClass2

How to add qualified cardinality in JENA

余生颓废 提交于 2019-11-30 15:30:23
How can I add qualified cardinality restriction in Jena? I can not use createCardinalityQRestriction because the OntModelSpec is for the first version of OWL, not OWL2. In ModelFactory's createOntologyModel, is there a way to create an OWL2 ontology? I need a class expression like JeVysledkom exactly 1 Kolik_Fazovy I've tried using this code: OntModel ontModel = ModelFactory.createOntologyModel(); OntClass ret = ontModel.createCardinalityQRestriction(null, ontProperty, cardinality, ontClass2 ); ontClass.addSuperClass(ret); but I get this exception: com.hp.hpl.jena.ontology.ProfileException:

get OWL restrictions on classes using Jena

淺唱寂寞╮ 提交于 2019-11-30 14:16:52
Using the pizza ontology , I want to be able to look up all the toppings for American pizza. If I open the ontology in Protégé, I can see that American pizza has the following restrictions: hasTopping some MozerellaTopping hasTopping some TomatoTopping How can I get the same information programatically through Jena? Here's my solution. I've just printed out the strings you ask for, but hopefully you can see from this how to use the Jena OntAPI to traverse an ontology graph and pick out the things you're interested in. package examples; import java.util.Iterator; import com.hp.hpl.jena.ontology

how can i add some triple to my Ontology by Jena?

大憨熊 提交于 2019-11-30 10:46:48
I have instance1 of class1 and instance2 of class2 . Also I have defined HasName(object property) in my ontology. Now, how can I add the triple ( instance1 HasName instance2 ) to my ontology by jena? Here's a way without dealing with intermediate Statements . // RDF Nodes -- you can make these immutable in your own vocabulary if you want -- see Jena's RDFS, RDF, OWL, etc vocabularies Resource class1 = ResourceFactory.createResource(yourNamespace + "class1"); Resource class2 = ResourceFactory.createResource(yourNamespace + "class1"); Property hasName = ResourceFactory.createProperty