jena

Java - Jena API - Output file

最后都变了- 提交于 2019-12-13 14:43:05
问题 I'm using Java and Jena API. I have a class Person with the datatype properties hasFirstName , hasLastName , hasDateOfBirth , hasGender . Here is how one person is represented in my RDF file. <rdf:Description rdf:about="http://www.fam.com/FAM#Bruno04/02/1980 "> <j.0:FAMhasGender>H</j.0:FAMhasGender> <j.0:FAMhasDateOfBirth>04/02/1980</j.0:FAMhasDateOfBirth> <j.0:FAMhasLastName>DS </j.0:FAMhasLastName> <j.0:FAMhasFirstName> Bruno</j.0:FAMhasFirstName> </rdf:Description> For each person whose

Developing a Semantic Web Application

回眸只為那壹抹淺笑 提交于 2019-12-13 11:18:27
问题 Although i have a little bit of experience in developing dynamic websites using ASP technologies, but I am new to semantic web programming, and i intend to implement a website based on semantic web technology.I would like to develop a search engine, where a web user can query for keywords from the backend RDF triple store.I want to implement the website using Java and JSP.I have following questions: I am currently studying Jena framework and SPARQL to start with,but i am not sure what other

To write a query SPARQL in Java code using strstarts filter

狂风中的少年 提交于 2019-12-13 09:36:54
问题 I would like to write this SPARQL query in Java using Jena: prefix dbpediaont: <http://dbpedia.org/ontology/> prefix dbpedia: <http://dbpedia.org/resource/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?resource where { dbpedia:Fred_Guy rdf:type ?resource filter strstarts(str(?resource), "http://dbpedia.org/ontology") } I'm using this code: public QueryExecution query(){ String stringa = "http://dbpedia.org/resource/Fred_Guy"; ParameterizedSparqlString qs = new

Get data from rdf file [duplicate]

a 夏天 提交于 2019-12-13 08:57:21
问题 This question already has an answer here : Closed 6 years ago . Possible Duplicate: Java - Using Jena APi - Get data from RDF file I'm using Java and Jena API. I have the class Person with the datatype properties hasFirstName , hasLastName , hasDateOfBirth , hasGender . Here is how one person is represented in my RDF file. <rdf:Description rdf:about="http://www.fam.com/FAM#Bruno04/02/1980 "> <j.0:FAMhasGender>H</j.0:FAMhasGender> <j.0:FAMhasDateOfBirth>04/02/1980</j.0:FAMhasDateOfBirth> <j.0

Enable HTTPS/SSL on Fuseki server?

ぃ、小莉子 提交于 2019-12-13 07:16:51
问题 Is it possible to configure the Fuseki server to run over HTTPS? Currently: http://mylinuxbox:3030/ <-- OK Desired: https://mylinuxbox:3030/ <-- results in error 回答1: AndyS's comments, which seem like they probably answer the question: here is a discussion about this on the jena users list for Fuseki v2 (development). For Fuseki1, you define it via the Jetty configuration setup. --jetty-config= Another way is to put a reverse proxy in and put Fuseki behind that. If you already know how to set

Pellet Reasoner with Jena

蹲街弑〆低调 提交于 2019-12-13 05:48:13
问题 I am running Pellet with Jena as the following: public void storeInferredModel(Data data) { System.out.println("creating inferred dataset "); Dataset dataset = TDBFactory.createDataset(data.getInferredResultsPath()); System.out.println("creating OntModel "); OntModel Infmodel = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, dataset.getNamedModel(this.URL)); System.out.println("adding schema (OWL) to OntModel"); Infmodel.add(this.owl); System.out.println("adding data (RDF)

Merge RDF .ttl files into one file database - filtering and keeping only the data/triples needed

梦想与她 提交于 2019-12-13 04:18:47
问题 I need to merge 1000+ .ttl files into one file database. How can I merge them with filtering the data in the source files and keep only the data needed in the target file? Thanks 回答1: There's a number of options, but the simplest way is probably to have use a Turtle parser to read all the files, and let that parser pass its output to a handler which does the filtering before in turn passing the data to a Turtle writer. Something like this would probably work (using RDF4J): RDFWriter writer =

building fulltext search index for jena and lucene

六月ゝ 毕业季﹏ 提交于 2019-12-13 03:24:47
问题 I would like to perform a full text search on a subset of dbpedia (which i have in a tdb store) with lucene and jena. String TDBDirectory = "path" ; Dataset dataset = TDBFactory.createDataset(TDBDirectory) ; But not over all resources, only over titles. I think by making indices only over the needed triples I can perform a faster search. E.g. <http://de.dbpedia.org/resource/Gurke> <http://www.w3.org/2000/01/rdf-schema#label> "Gurke"@de . Here I would like to search for "Gurke", but not in any

SPARQL query REGEX boundary in java returns empty

删除回忆录丶 提交于 2019-12-13 02:55:13
问题 i'm new in SPARQL and Jena. Here i'm using Jena version 2.13. I would like to perform a SPARQL query from java web application with REGEX boundary (\b) . I'm using REGEX boundary to match and find exact word. I'm running the same SPARQL query on protege too. Here my SPARQL query in java : "PREFIX foaf: <http://xmlns.com/foaf/0.1/> " + "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#

RDFDataMgr write does not work with milion objects

为君一笑 提交于 2019-12-13 02:54:22
问题 I have java application which works with jena tdb. I have 3 milion objects in the db and when i want to make export on jena i am having problems. For export i tried with: RDFDataMgr.write(file, model, Lang.RDFXML); and also with: RDFWriter writer = model.getWriter("RDF/XML"); writer.setProperty("allowBadURIs", true); writer.setProperty("relativeURIs", ""); writer.setProperty("tab", "2"); writer.setProperty("showXmlDeclaration", "true"); writer.write(model, file, null); But non of this worked.