This repository includes a prototype implementation of an EMF resource for RDF graphs, on top of Apache Jena.
It can be installed from the repository's update site: see README
for details.
This implementation has some major differences with emf-triple:
- A single resource can combine information from multiple sources (e.g. Turtle or RDF/XML files).
- OWL inference is supported.
These differences are achieved by loading an intermediary .rdfres
file with all the data and schema models to be combined, as well as any relevant options.
- Saving is not supported at the moment.
Suppose you have a model.ttl
Turtle file with some statements of interest, written against an ontology in schema.ttl
.
Suppose as well that the RDF resources in model.ttl
follows certain conventions that relate them to an Ecore metamodel, in the MOF2RDF style:
- There are
rdf:type
predicates from the RDF resource to another RDF resource whose URI isePackageNamespaceURI#eClassName
. - Statements use predicates with URIs of the form
ePackageNamespaceURI#eStructuralFeatureName
:- Predicate objects can be other RDF resources (in the case of
EReference
s), or literals (in the case ofEAttribute
s). - RDF lists are supported for many-valued features.
- Predicate objects can be other RDF resources (in the case of
In that case, you could write an .rdfres
file like this, and load it as an EMF resource where the relevant RDF resources would be deserialised into EMF EObject
s:
dataModels:
- model.ttl
schemaModels:
- schema.ttl
The .rdfres
file can then be loaded and used by any EMF-compatible tool as usual.
Note that the elements in dataModels
and schemaModels
can be arbitrary URIs understood by the RIOT system in Jena, and not just relative paths from the folder of the .rdfres
file.
RDF model validation can be enabled by adding a line in the .rdfres
, e.g. validationMode: jena-clean
. The following validation modes are available :
- none
- jena-valid: validation passes if the model has no internal inconsistencies, even though there may be some warnings.
- jena-clean: validation passes if the model has no internal inconsistencies and there are no warnings.
validationMode: jena-clean
dataModels:
- model.ttl
schemaModels:
- schema.ttl