Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Again, this is a change in the semantics of OntModelSelectors. It insures a consistent representation of OntModels across OntModelSelectors, but it is certainly possible that existing code relies on an inconsistent model instead.

The RDF Service

Note

TBD

Model makers and Model sources

The ModelAccess class

...

Interface for API to write, read, and update Vitro's RDF store, with support to allow listening, logging and auditing. Moreover, it is an intefrace for API to perform a SPARQL select query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.

At the end, implementation of this interface should enable serialization of the contents of the named graph to the supplied OutputStream, in N-Triples format. 

Model makers and Model sources

The ModelAccess class

The root access point for the RDF data structures: RDFServices, Datasets, ModelMakers, OntModels, OntModelSelectors and WebappDaoFactories.
Enables getting a long-term data structure by accessing from the context.

Code Block
ModelAccess.on(ctx).getRDFService(CONFIGURATION); 

Moreover it enables getting a short-term data structure by accessing from the request.

Code Block
ModelAccess.on(req).getOntModel(ModelNames.DISPLAY);

The elaborate structure of options enums allows us to specify method signatures like this on RequestModelAccess:

Code Block
getOntModelSelector(OntModelSelectorOption... options);

Which can be invoked in any of these ways:

Code Block
ModelAccess.on(req).getOntModelSelector();
ModelAccess.on(req).getOntModelSelector(LANGUAGE_NEUTRAL);
ModelAccess.on(req).getOntModelSelector(INFERENCES_ONLY);
ModelAccess.on(req).getOntModelSelector(ASSERTIONS_ONLY, LANGUAGE_NEUTRAL);

The compiler insures that only appropriate options are specified. However, if conflicting options are supplied, it will only be caught at runtime

...

.

Initializing the Models

When VIVO starts up, OntModel objects are created to represent the various data models. The configuration models are created from the datasource connection, usually to a MySQL database. The content models are created using the new RDFService layer. By default this also uses the datasource connection, but it can be configured to use any SPARQL endpoint for its data.

...