Assembler quickstart

This is the Assembler quickstart page. For more detailed information, see the Assembler howto document.

what is an Assembler specification?

An Assembler specification is an RDF description of how to construct a model and its associated resources, such as reasoners, prefix mappings, and initial content. The Assembler vocabulary is given in the Assembler schema, and we'll use the prefix ja for its identifiers.

what is an Assembler?

An Assembler is an object that implements the Assembler interface and can construct objects (typically models) from Assembler specifications. The constant Assembler.general is an Assembler that knows how to construct the usual suspects.

how can I make a model according to a specification?

Suppose the Model M contains an Assembler specification whose root -- the Resource describing the whole Model to construct is R (so R.getModel() == M). Invoke:

Assembler.general.openModel(R)

The result is the desired Model. Further details about the Assembler interface, the special Assembler general, and the details of specific Assemblers, are deferred to the Assembler howto.

how can I specify ...

In the remaining sections, the object we want to describe is given the root resource my:root, and our examples are written in N3.

... a memory model?

my:root a ja:MemoryModel.

... an inference model?

my:root 
    ja:reasoner [ja:reasonerURL theReasonerURL]
    ; ja:baseModel theBaseModelResource
    .
theReasonerURL is one of the reasoner (factory) URLs given in the inference documentation and code; theBaseModelResource is another resource in the same document describing the base model.

... a database model?

my:root
    ja:connection aConnectionresource
    ; ja:modelName "myModelName"
    .
    
aConnectionResource
    ja:dbURL theDatabaseURL
    ; ja:dbUser "the user name"
    ; ja:dbPassword "the user's password"
    ; ja:dbType "the database type, eg MySQL"
    ; ja:dbClass "some.jena.driver.class"
    .
aConnectionResource describes the connection to the desired database. If a particular Java driver class has to be loaded, it is specified by the dbClass property value. See the Assembler howto for ways in which sensitive details such as passwords can be left out of the description.

... some initialising content?

my:root
    ja:content [ja:externalContent <someContentURL>]
    ... rest of model specification ...
    .
The model will be preloaded with the contents of someContentURL.

... an ontology model?

my:root
    ja:ontModelSpec ja:OntModelSpecName
    ; ja:baseModel somebaseModel
    .
The OntModelSpecName can be any of the predefined Jena OntModelSpec names, eg OWL_DL_MEM_RULE_INF. The baseModel is another model description - it can be left out, in which case you get an empty memory model. See Assembler howto for construction of non-predefined OntModelSpecs.