Questions tagged [jena]

Apache Jena is an open-source Java library for processing "Resource-Description-Framework" (RDF) data in semantic web and linked-data applications. This includes command-line tools for RDF-based applications.

Apache Jena is an open-source Java library for processing Resource-Description-Framework (RDF) data in semantic web and linked-data applications. This includes command-line tools for RDF-based applications.

Links

Summary

Jena is an open-source Java library for processing RDF data. Originally developed by HP Labs, the project was accepted by Apache as an incubator project in 2010, and graduated from the incubator to become Apache Jena in April 2012. RDF is a standard notation for representing information about things in the world, and especially resources on the World Wide Web. RDF was developed by the W3C as part of its semantic web activity. Related W3C standards include the query language SPARQL and ontology language OWL.

RDF builds representations from a simple basic propositional structure, in which some object stands in some named relation to some subject. For example,

StackOverflow is-about programming-questions

Here, StackOverflow is the subject, the category programming questions is the object, and the named predicate denoting the relationship between subject and object is is about. In order to work effectively with resources on the WWW, names of things, including names of predicates, are URI's, so we might actually write the previous example using http://www.stackoverflow.com as the subject, the Dublin Core property has subject as the predicate and the DBPedia resource for computer programming as the object. Thus:

<http://www.stackoverflow.com>
   <http://purl.org/dc/terms/subject>
       <http://dbpedia.org/resource/Category:Computer_programming>

This basic building block of RDF representations has three elements, subject, predicate and object, and so is often referred to as a triple, and a data structure for storing triples is typically called a triplestore. Since the object of one triple can be the subject of another, a graph structure can be built to represent quite complex descriptions.

Jena includes parsers for all of the main encoding syntaxes for RDF triples: RDF/XML, Turtle, N-Triples and RDFa, and generators for the first three (RDFa is embedded in an HTML document, so cannot be generated simply by serializing an RDF graph). Jena has a complete implementation of the SPARQL query language for RDF, and tracks recent decisions by the relevant W3C working groups. Jena also includes a convenience API and rule-based reasoner for handling OWL ontologies, though is currently restricted to version 1 of OWL. The rule engine can also be used with custom rule-sets developed by the user. Jena's storage strategies for RDF graphs range from simple in-memory data structures to custom persistent stores using B-trees or building on top of existing relational engines. Jena also includes a range of command-line tools to assist developers with a variety of standard tasks, from checking RDF documents to initializing persistent stores.

Questions tagged with the Jena tag can be about any aspect of programming semantic web applications using the Jena library. General questions about the semantic web, or about linked data applications, but not involving Jena per se should not use this tag.

2388 questions
7
votes
1 answer

RDF - More than one Object for one Subject-Property

I've got one (maybe) simple question: Can I assign more than one ObjectResource to a fixed Subject-Property Statement? I want my RDF-Triples look like that: [http://somewhere/Angela_Merkel, http://somewhere/properties#isMentionedIn,…
malwin
  • 652
  • 7
  • 18
7
votes
2 answers

JSON-LD in Jena RIOT?

I got Jena 2.12.1 (2014-10-02) from the Apache Jena Releases page. It's supposed to have JSON-LD support, according to Reading and Writing RDF in Apache Jena. But when I try to use riot with an output format of JSON-LD, I get an error (and the same…
Vladimir Alexiev
  • 2,477
  • 1
  • 20
  • 31
7
votes
3 answers

Using Jena reasoner on Neo4J db

it's my first time writing here but i'm really struck with a problem: is it possible to use the Jena reasoner on a No-SQL database, like Neo4J, already filled with data? I've a Neo4J's graph rappresenting a bunch of triples and I would like to use…
Ancelot182
  • 149
  • 1
  • 7
7
votes
3 answers

Which knowledge base/rule-based inference engine to choose for real time Runway incursion prevention system

we are designing a project that would listen to dialog between airport controllers and pilots to prevent runway incursions (eg. one airplane is taking off while other is crossing the runway). Our professor wants us to use Jena for knowledge base (or…
Denis Tulskiy
  • 19,012
  • 6
  • 50
  • 68
7
votes
1 answer

Using GROUP BY, COUNT and SAMPLE in apache jena SPARQL

So I have an RDF schema that contains many "groups", and each of these groups has a "name", and contains a number of "elements". I need to select the name of every group, along with the number of elements for each. Here is a sample of a group RDF…
user641687
7
votes
2 answers

Jena - How to know whether a specific resource is in the model?

I am trying to discover whether I had a specific resource in the model. For that I am using: model.getResource("example") Checking the doc, this method behaves exactly as createResource. Then, even if it is not in the model, I will get a new…
jevora
  • 469
  • 1
  • 5
  • 14
7
votes
1 answer

How to reduce the size of the TDB-backed Jena Dataset?

I am working with a simple Jena dataset, which only has a single ~30 MB RDF file imported. As a part of the application, I am trying to let users query the default graph (or a named graph) and insert the resulting triples from the query into a new…
paul
  • 651
  • 1
  • 5
  • 12
7
votes
1 answer

Combine multiple sets of rows in SPARQL

I cannot describe my problem formally due to my bad English; let me tell it using an example. The table below is actually grouped by 'subject','predicate'. We define a set on rows, if they the same 'subject'. Now I want to combine any two sets if…
bobharris
  • 173
  • 3
  • 10
6
votes
2 answers

Querying with Spaces Sparql

Say if I want to return the result "having fun" of the triple. I don't know how to account for the space in between the words. Below is a query I tried but it didn't work. Let me know if anyone can spot what I doing wrong
Sam
  • 1,479
  • 3
  • 14
  • 16
6
votes
1 answer

SPARQL Querying for RDF File

I have a RDF File like the one shown below. But I am finding it hard to do queries on it. For example could anyone tell me a simple query where I could extract the about (http://websitename.com/urls/a) or resource (http://websitename.com/urls/b) or…
Sam
  • 1,479
  • 3
  • 14
  • 16
6
votes
2 answers

get OWL restrictions on classes using Jena

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…
user672365
  • 221
  • 1
  • 4
  • 11
6
votes
0 answers

How do I install Apache Jena/Java on Ubuntu?

total database and Java noob here. Need to start learning how to use Jena (I will probably spend a long time reading the official documentation since It looks decent) but I don't know how to actually set it up, since I don't know a thing about Java…
guib
  • 115
  • 5
6
votes
1 answer

how to extract synonyms from MeSH ontology?

In this level of my work, I need to extract a class synonyms from MeSH ontology. I am searching for the right syntax for the SPARQL query: how synonyms are they stored in MeSH? and how can I extract them?
safé
  • 175
  • 3
  • 12
6
votes
1 answer

Loading Notation3 into a Database

How do you parse and load the triples represented by a Notation3 file into a database? I'm somewhat familiar with Jena and Sesame, but these seemed geared to process RDF or Turtle, not full Notation3. I've found relatively few robust tools for…
Cerin
  • 60,957
  • 96
  • 316
  • 522
6
votes
1 answer

Apache Jena all release notes so far

I am trying to find all the release notes of each of the versions released so far for Apache Jena. Where can I find it?
Pratik
  • 908
  • 2
  • 11
  • 34