Apache Commons RDF logo

Apache Commons RDF (incubating)

Commons RDF aims to provide a common library for RDF 1.1 that could be implemented by systems on the Java Virtual Machine.

The main motivation behind this simple library is revise an historical incompatibility issue. This library does not pretend to be a generic api wrapping those libraries, but a set of interfaces for the RDF 1.1 concepts that can be used to expose common RDF-1.1 concepts using common Java interfaces. In the initial phase commons-rdf is focused on a subset of the core concepts defined by RDF-1.1 (URI/IRI, Blank Node, Literal, Triple, and Graph). In particular, commons RDF aims to provide a type-safe, non-general API that covers RDF 1.1. In a future phase we may define interfaces for Datasets and Quads.

API

The class diagram on the right depicts the main interfaces which may be included in Commons RDF, specifically:

  • Graph: a graph, a set of RDF triples.
  • Triple: a (subject, predicate, object) RDF triple.
  • RDFTerm: a RDF 1.1 Term, where IRIs, literals and blank nodes are collectively known as RDF terms.
  • IRI: an Internationalized Resource Identifier.
  • BlankNode: a RDF-1.1 Blank Node, where they are disjoint from IRIs and literals.
  • BlankNodeOrIRI: this interface represents the RDF Terms that may be used in the subject position of an RDF 1.1 Triple, including BlankNode and IRI.
  • Literal: a RDF-1.1 literal.
  • RDFTermFactory: factory for creating RDFTerm and Graph instances.

The design of the API follows the terminology as defined by RDF 1.1 Concepts and Abstract Syntax, a W3C Recommendation published on 25 February 2014. The idea is that Commons RDF will provide a common library for RDF 1.1 that could be implemented by systems on the Java Virtual Machine, allowing the portability across different implementations.

See the the user guide for examples of how to interact with these interfaces.

Modules

The project is composed by two modules:

  • API defines a common library of RDF 1.1 concepts.
  • Simple provides a simple implementation, mainly for internal validation and very simple scenarios.

Both modules follow the semantic versioning principles, where version x.y.z of Simple implements version x.y of the API; i.e., the version z are backwards-compatible patches of the implementation.

External implementations of the Commons RDF API are being developed as part of their retrospective projects. Contributions welcome!

Contributing

Please, take into account that this library is still work in progress, this set of interfaces are still under discussion and evolution. Therefore everybody is welcomed to join the project and contribute!

Disclaimer

Apache Commons RDF is an effort undergoing incubation at The Apache Software Foundation (ASF) sponsored by the Apache Incubator PMC. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Apache Incubator