Commons RDF aims to provide a common
library for RDF 1.1 with implementations
for common Java RDF frameworks like RDF4J, Apache
Jena as well as for other libraries such as
OWLAPI,
Clerezza and other JVM languages.
The main motivation behind this simple library is to revise an historical
incompatibility issue between these toolkits. This library does not pretend to
be a generic API wrapping those libraries, but is a
set of common Java interfaces
for the RDF 1.1 concepts, e.g. IRI, BlankNode, Graph,
accompanied with unit test cases for their expected behavior, and a simple
implementation, which main purpose is to clarify the tests and interfaces.
In particular, Commons RDF aims to provide a type-safe, non-general API that
covers RDF 1.1.
A diagram of the interfaces included in Commons RDF:
Everybody is welcomed to join the project and
contribute!
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
“License”); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributing
Feel free to subscribe to the
dev@commons
mailing list, use the
Subject tag [RDF]
to follow the ongoing development of Commons RDF, ask questions
about its usage, or help shape Commons RDF by
contributing
your ideas, code and use cases.
.. and an equivalent <dependency> for the
implementation
you would like, e.g. commons-rdf-simple.
The <version> above might not be up to date,
see the downloads to
use the latest stable release published in Maven Central.
Snapshot repository
The Apache Commons RDF project is aiming to regularly release early
previews releases (0.x.y versions) and publish these to Maven Central.
See the downloads to
use the latest stable release.
The commons-rdf-simple module contains a
simple (if not naive) implementation of the Commons RDF API
using in-memory POJO objects.
Note that although this module fully implements the commons-rdf API,
it should not be considered a reference implementation.
It is not thread-safe nor scalable, but may be useful for testing
and simple usage (e.g. output from an independent RDF parser).
Apache Commons RDF
Commons RDF aims to provide a common library for RDF 1.1 with implementations for common Java RDF frameworks like RDF4J, Apache Jena as well as for other libraries such as OWLAPI, Clerezza and other JVM languages.
The main motivation behind this simple library is to revise an historical incompatibility issue between these toolkits. This library does not pretend to be a generic API wrapping those libraries, but is a set of common Java interfaces for the RDF 1.1 concepts, e.g.
IRI,BlankNode,Graph, accompanied with unit test cases for their expected behavior, and asimpleimplementation, which main purpose is to clarify the tests and interfaces.In particular, Commons RDF aims to provide a type-safe, non-general API that covers RDF 1.1.
A diagram of the interfaces included in Commons RDF:
Everybody is welcomed to join the project and contribute!
See the Commons RDF homepage for more details.
License
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributing
Feel free to subscribe to the dev@commons mailing list, use the Subject tag
[RDF]to follow the ongoing development of Commons RDF, ask questions about its usage, or help shape Commons RDF by contributing your ideas, code and use cases.Building
Building has been tested with Apache Maven 3 and Java 11 and up.
To then use this build from your project, add to Maven (update
<version>to match the Maven output):.. and an equivalent
<dependency>for the implementation you would like, e.g.commons-rdf-simple.The
<version>above might not be up to date, see the downloads to use the latest stable release published in Maven Central.Snapshot repository
The Apache Commons RDF project is aiming to regularly release early previews releases (0.x.y versions) and publish these to Maven Central. See the downloads to use the latest stable release.
However, if you are following the ongoing development on dev@commons, (using subject tag
[RDF]) you may want to try the snapshot builds, which are automatically deployed to the Apache snapshot repository.To use these snapshots from your Maven project, depend on the latest
*-SNAPSHOTversion as found in the current pom.xml, and add to your ownpom.xml:Simple implementation
The commons-rdf-simple module contains a simple (if not naive) implementation of the Commons RDF API using in-memory POJO objects.
Note that although this module fully implements the commons-rdf API, it should not be considered a reference implementation. It is not thread-safe nor scalable, but may be useful for testing and simple usage (e.g. output from an independent RDF parser).
Testing
The abstract classes AbstractGraphTest, AbstractDatasetTest, AbstractBlankNodeTest and AbstractRDFTest can be realised as JUnit tests by implementations in order to verify that they pass the minimal requirements of this API.
In order for this to work, your project will need to depend on the
testsclassifier for the commons-rdf-api module, for example (for Maven):The extensions of each Test class need to provide a RDF instance that can create the corresponding implementations of a
Graph,IRI, etc.For an example, see SimpleGraphTest.