public class AssemblerHelp extends Object
Constructor and Description |
---|
AssemblerHelp() |
Modifier and Type | Method and Description |
---|---|
static Set<Resource> |
findAssemblerRoots(Model model)
Answer a Set of the ja:Object resources in the full expansion of
the assembler specification model
model . |
static Set<Resource> |
findAssemblerRoots(Model model,
Resource type)
Answer a Set of the objects in the full expansion of the assembler
specification
model which have rdf:type type ,
which must be a subtype of ja:Object . |
static Resource |
findSpecificType(Resource root)
Answer the most specific type of
root that is a subclass of
ja:Object. |
static Resource |
findSpecificType(Resource root,
Resource baseType)
Answer the most specific type of
root that is a subclass of
givenType . |
static Set<Resource> |
findSpecificTypes(Resource root,
Resource baseType)
Answer all the types of
root which are subtypes of
baseType and which do not have subtypes which are
also types of root . |
static Model |
fullModel(ImportManager im,
Model m)
Answer the full model of
m , with all its imports included and
with the necessary properties added from the JA schema. |
static Model |
fullModel(Model m)
Answer the full model of
m , with all its imports included and
with the necessary properties added from the JA schema. |
static Resource |
getResource(Statement s)
Answer the resource that is the object of the statement
s . |
static String |
getString(Statement s)
Answer the plain string object of the statement
s . |
static String |
getString(Statement s,
Literal L)
Answer the String value of the literal
L , which is the
object of the Statement s . |
static void |
loadArbitraryClasses(AssemblerGroup g,
Model m)
Load all the classes which are objects of any (t, ja:loadClass, S)
statements in
m . |
static void |
loadAssemblerClasses(AssemblerGroup group,
Model m)
Load all the classes which are objects of any (t, ja:assembler, S) statements
in
m . |
static Resource |
singleModelRoot(Model singleRoot)
Answer the single resource in
singleRoot of type
ja:Model . |
static Resource |
singleRoot(Model singleRoot,
Resource type)
Answer the single resource in
singleRoot of type
type . |
static Resource |
withFullModel(Resource root)
Answer a Resource .equals() to
root , but in the expanded
model. |
public static Resource withFullModel(Resource root)
root
, but in the expanded
model.public static Model fullModel(Model m)
m
, with all its imports included and
with the necessary properties added from the JA schema. However, if
the magic footprint triple (ja:this, rdf:type, ja:Expanded) is present in the
model, it is returned unchanged. Imports are managed by the shared
ImportManager.instance
.public static Model fullModel(ImportManager im, Model m)
m
, with all its imports included and
with the necessary properties added from the JA schema. However, if
the magic footprint triple (ja:this, rdf:type, ja:Expanded) is present in the
model, it is returned unchanged. Imports are managed by im
.public static void loadArbitraryClasses(AssemblerGroup g, Model m)
m
. The order in which the classes are
loaded is not specified, and loading stops immediately if any class
cannot be loaded.
Contrast with loadClasses(AssemblerGroup,Model)
,
which loads classes and assumes that those classes are assemblers to
be added to the group.
public static void loadAssemblerClasses(AssemblerGroup group, Model m)
m
. group.implementWIth(t,c)
is called
for each statement, where c
is an instance of the class named
by S
. The order in which the classes are loaded is not
specified, and loading stops immediately if any class cannot be loaded.public static Resource findSpecificType(Resource root)
root
that is a subclass of
ja:Object. If there are no candidate types, answer givenType
.
If there is more than one type, throw a NoSpecificTypeException.public static Resource findSpecificType(Resource root, Resource baseType)
root
that is a subclass of
givenType
. If there are no candidate types, answer
givenType
. If there is more than one type, throw a
NoSpecificTypeException.public static Set<Resource> findSpecificTypes(Resource root, Resource baseType)
root
which are subtypes of
baseType
and which do not have subtypes which are
also types of root
.public static Resource getResource(Statement s)
s
. If
the object is not a resource, throw a BadObjectException with that statement.public static String getString(Statement s)
s
. If the
object is not a string literal, throw a BadObjectException with that statement.public static String getString(Statement s, Literal L)
L
, which is the
object of the Statement s
. If the literal is not an
XSD String or a plain string without a language code, throw a
BadObjectException.public static Set<Resource> findAssemblerRoots(Model model)
model
.public static Set<Resource> findAssemblerRoots(Model model, Resource type)
model
which have rdf:type type
,
which must be a subtype of ja:Object
.public static Resource singleModelRoot(Model singleRoot)
singleRoot
of type
ja:Model
. Otherwise throw an exception.Licenced under the Apache License, Version 2.0