blob: a4e5c453fa5dab0fbca431ec1c400add86af856f [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<title>Apache Jena - Jena architecture overview</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="/css/bootstrap-icons.css" rel="stylesheet" media="screen">
<link href="/css/jena.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="/images/favicon.ico" />
</head>
<body>
<nav class="navbar navbar-expand-lg bg-body-tertiary" role="navigation">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="/index.html">
<img class="logo-menu" src="/images/jena-logo/jena-logo-notext-small.png" alt="jena logo">Apache Jena</a>
</div>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li id="homepage" class="nav-item"><a class="nav-link" href="/index.html"><span class="bi-house"></span> Home</a></li>
<li id="download" class="nav-item"><a class="nav-link" href="/download/index.cgi"><span class="bi-download"></span> Download</a></li>
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false"><span class="bi-journal"></span> Learn <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Tutorials</li>
<li><a class="dropdown-item" href="/tutorials/index.html">Overview</a></li>
<li><a class="dropdown-item" href="/documentation/fuseki2/index.html">Fuseki Triplestore</a></li>
<li><a class="dropdown-item" href="/documentation/notes/index.html">How-To's</a></li>
<li><a class="dropdown-item" href="/documentation/query/manipulating_sparql_using_arq.html">Manipulating SPARQL using ARQ</a></li>
<li><a class="dropdown-item" href="/tutorials/rdf_api.html">RDF core API tutorial</a></li>
<li><a class="dropdown-item" href="/tutorials/sparql.html">SPARQL tutorial</a></li>
<li><a class="dropdown-item" href="/tutorials/using_jena_with_eclipse.html">Using Jena with Eclipse</a></li>
<li class="dropdown-divider"></li>
<li class="dropdown-header">References</li>
<li><a class="dropdown-item" href="/documentation/index.html">Overview</a></li>
<li><a class="dropdown-item" href="/documentation/query/index.html">ARQ (SPARQL)</a></li>
<li><a class="dropdown-item" href="/documentation/assembler/index.html">Assembler</a></li>
<li><a class="dropdown-item" href="/documentation/tools/index.html">Command-line tools</a></li>
<li><a class="dropdown-item" href="/documentation/rdfs/">Data with RDFS Inferencing</a></li>
<li><a class="dropdown-item" href="/documentation/geosparql/index.html">GeoSPARQL</a></li>
<li><a class="dropdown-item" href="/documentation/inference/index.html">Inference API</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc.html">Javadoc</a></li>
<li><a class="dropdown-item" href="/documentation/ontology/">Ontology API</a></li>
<li><a class="dropdown-item" href="/documentation/permissions/index.html">Permissions</a></li>
<li><a class="dropdown-item" href="/documentation/extras/querybuilder/index.html">Query Builder</a></li>
<li><a class="dropdown-item" href="/documentation/rdf/index.html">RDF API</a></li>
<li><a class="dropdown-item" href="/documentation/rdfconnection/">RDF Connection - SPARQL API</a></li>
<li><a class="dropdown-item" href="/documentation/io/">RDF I/O</a></li>
<li><a class="dropdown-item" href="/documentation/rdfstar/index.html">RDF-star</a></li>
<li><a class="dropdown-item" href="/documentation/shacl/index.html">SHACL</a></li>
<li><a class="dropdown-item" href="/documentation/shex/index.html">ShEx</a></li>
<li><a class="dropdown-item" href="/documentation/jdbc/index.html">SPARQL over JDBC</a></li>
<li><a class="dropdown-item" href="/documentation/tdb/index.html">TDB</a></li>
<li><a class="dropdown-item" href="/documentation/tdb2/index.html">TDB2</a></li>
<li><a class="dropdown-item" href="/documentation/query/text-query.html">Text Search</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false"><span class="bi-journal-code"></span> Javadoc <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/documentation/javadoc.html">All Javadoc</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/arq/">ARQ</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/fuseki2/">Fuseki</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/geosparql/">GeoSPARQL</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/jdbc/">JDBC</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/jena/">Jena Core</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/permissions/">Permissions</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/extras/querybuilder/">Query Builder</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/shacl/">SHACL</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/tdb/">TDB</a></li>
<li><a class="dropdown-item" href="/documentation/javadoc/text/">Text Search</a></li>
</ul>
</li>
</ul>
<ul class="navbar-nav ms-auto">
<li id="ask" class="nav-item"><a class="nav-link" href="/help_and_support/index.html"><span class="bi-patch-question"></span> Ask</a></li>
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false"><span class="bi-megaphone"></span> Get involved <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/getting_involved/index.html">Contribute</a></li>
<li><a class="dropdown-item" href="/help_and_support/bugs_and_suggestions.html">Report a bug</a></li>
<li class="dropdown-divider"></li>
<li class="dropdown-header">Project</li>
<li><a class="dropdown-item" href="/about_jena/about.html">About Jena</a></li>
<li><a class="dropdown-item" href="/about_jena/architecture.html">Architecture</a></li>
<li><a class="dropdown-item" href="/about_jena/citing.html">Citing</a></li>
<li><a class="dropdown-item" href="/about_jena/team.html">Project team</a></li>
<li><a class="dropdown-item" href="/about_jena/contributions.html">Related projects</a></li>
<li><a class="dropdown-item" href="/about_jena/roadmap.html">Roadmap</a></li>
<li><a class="dropdown-item" href="/about_jena/security-advisories.html">Security Advisories</a></li>
<li class="dropdown-divider"></li>
<li class="dropdown-header">ASF</li>
<li><a class="dropdown-item" href="https://www.apache.org/">Apache Software Foundation</a></li>
<li><a class="dropdown-item" href="https://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
<li><a class="dropdown-item" href="https://www.apache.org/licenses/LICENSE-2.0">License</a></li>
<li><a class="dropdown-item" href="https://www.apache.org/security/">Security</a></li>
<li><a class="dropdown-item" href="https://www.apache.org/foundation/thanks.html">Thanks</a></li>
</ul>
</li>
<li class="nav-item" id="edit"><a class="nav-link" href="https://github.com/apache/jena-site/edit/main/source/about_jena/architecture.md" title="Edit this page on GitHub"><span class="bi-pencil-square"></span> Edit this page</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="breadcrumbs">
<ol class="breadcrumb mt-4 p-2 bg-body-tertiary">
<li class="breadcrumb-item"><a href='/about_jena'>ABOUT JENA</a></li>
<li class="breadcrumb-item active">ARCHITECTURE</li>
</ol>
</div>
<h1 class="title">Jena architecture overview</h1>
<p>There&rsquo;s quite a lot of code inside Jena, and it can be daunting for new Jena
users to find their way around. On this page we&rsquo;ll summarise the
key features and interfaces in Jena, as a general overview and guide to the
more detailed documentation.</p>
<p>At its core, Jena stores information as RDF triples in directed graphs, and allows
your code to add, remove, manipulate, store and publish that information. We
tend to think of Jena as a number of major subsystems with clearly
defined interfaces between them. First let&rsquo;s start with the big picture:</p>
<p><img src="/images/jena-architecture.png" alt="Jena architecture overview" title="Jena architecture overview"></p>
<p>RDF triples and graphs, and their various components, are accessed through Jena&rsquo;s
RDF API. Typical abstractions here are <code>Resource</code> representing an
RDF resource (whether named with a URI or anonymous), <code>Literal</code> for data
values (numbers, strings, dates, etc), <code>Statement</code> representing an RDF
triple and <code>Model</code> representing the whole graph. The RDF API has basic
facilities for adding and removing triples to graphs and finding triples that match
particular patterns. Here you can also read in RDF from external sources, whether
files or URL&rsquo;s, and serialize a graph in correctly-formatted text form. Both input
and output support most of the commonly-used RDF syntaxes.</p>
<p>While the programming interface to <code>Model</code> is quite rich,
internally, the RDF graph is stored in a much simpler abstraction named <code>Graph</code>.
This allows Jena to use a variety of different storage strategies equivalently, as long
as they conform to the <code>Graph</code> interface. Out-of-the box, Jena can store
a graph as an in-memory store, or as a persistent store using a
custom disk-based tuple index. The graph interface is also a convenient extension point
for connecting other stores to Jena, such as LDAP, by writing an adapter that allows
the calls from the <code>Graph</code> API to work on that store.</p>
<p>A key feature of semantic web applications is that the semantic rules of RDF, RDFS and
OWL can be used to <em>infer</em> information that is not explicitly stated in the graph. For example,
if class C is a sub-class of class B, and B a sub-class of A, then by implication C is
a sub-class of A. Jena&rsquo;s inference API provides the means to make these <em>entailed triples</em>
appear in the store just as if they had been added explicitly. The inference API provides
a number of rule engines to perform this job, either using the built-in rulesets for OWL
and RDFS, or using application custom rules. Alternatively, the inference API can be
connected up to an external reasoner, such as description logic (DL) engine, to perform
the same job with different, specialised, reasoning algorithms.</p>
<p>The collection of standards that define semantic web technologies includes SPARQL -
the query language for RDF. Jena conforms to all of the published standards, and tracks
the revisions and updates in the under-development areas of the standard. Handling
SPARQL, both for query and update, is the responsibility of the SPARQL API.</p>
<p>Ontologies are also key to many semantic web applications. Ontologies are formal logical
descriptions, or <em>models</em>, of some aspect of the real-world that applications have to
deal with. Ontologies can be shared with other developers and researchers, making it a
good basis for building linked-data applications. There are two ontology languages
for RDF: RDFS, which is rather weak, and OWL which is much more expressive. Both languages
are supported in Jena though the Ontology API, which provides convenience methods that
know about the richer representation forms available to applications through OWL and RDFS.</p>
<p>While the above capabilities are typically accessed by applications directly through the
Java API, publishing data over the Internet is a common requirement in modern applications.
Fuseki is a data publishing server, which can present, and update, RDF models over the
web using SPARQL and HTTP.</p>
<p>There are many other pieces to Jena, including command-line tools, specialised indexes for
text-based lookup, etc. These, and further details on the pieces outlined above, can be
found in the detailed documentation on this site.</p>
</div>
</div>
</div>
<footer class="bd-footer py-4 py-md-5 mt-4 mt-lg-5 bg-body-tertiary">
<div class="container" style="font-size:80%" >
<p>
Copyright &copy; 2011&ndash;2023 The Apache Software Foundation, Licensed under the
<a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
</p>
<p>
Apache Jena, Jena, the Apache Jena project logo, Apache and the Apache feather logos are trademarks of
The Apache Software Foundation.
<br/>
<a href="https://privacy.apache.org/policies/privacy-policy-public.html"
>Apache Software Foundation Privacy Policy</a>.
</p>
</div>
</footer>
<script src="/js/popper.min.js.js" type="text/javascript"></script>
<script src="/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/js/improve.js" type="text/javascript"></script>
<script type="text/javascript">
const link = document.querySelector(`a[href="${window.location.pathname}"]`);
if (link !== undefined && link !== null) {
const parents = link.parentElement
for (const parent of parents) {
if (parent.tagName === 'ul' || parent.tagName === 'li') {
parent.style += 'active';
}
}
}
</script>
</body>
</html>