|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.http.rest.DefinitionFactoryBase
info.sswap.http.rest.PropertyFactory
public class PropertyFactory
Creates property definitions based on their description in JSON.
Nested Class Summary | |
---|---|
private static class |
PropertyFactory.PropertyType
An enumeration for a type of a property: object property vs. |
Field Summary | |
---|---|
private static PropertyFactory |
instance
The single instance of this factory. |
Constructor Summary | |
---|---|
private |
PropertyFactory()
Private constructor for a singleton |
Method Summary | |
---|---|
private info.sswap.api.model.SSWAPDatatype |
createComplexDatatype(info.sswap.api.model.SSWAPDocument document,
Entity value)
|
private info.sswap.api.model.SSWAPDatatype |
createDatatype(info.sswap.api.model.SSWAPDocument document,
Value value)
|
private java.util.Collection<info.sswap.api.model.SSWAPDatatype> |
createDatatypes(info.sswap.api.model.SSWAPDocument document,
Value value)
|
private java.util.Collection<info.sswap.api.model.SSWAPPredicate> |
createEmptyProperties(info.sswap.api.model.SSWAPDocument document,
Value value)
|
private info.sswap.api.model.SSWAPPredicate |
createEmptyProperty(info.sswap.api.model.SSWAPDocument document,
Value value)
Creates an empty SSWAPPredicate object with the given URI. |
info.sswap.api.model.SSWAPPredicate |
createPredicate(info.sswap.api.model.SSWAPDocument document,
Entity jsonProperty)
Creates a property definition in the specified model and based on the JSON description |
private PropertyFactory.PropertyType |
determinePropertyType(info.sswap.api.model.SSWAPPredicate predicate,
Entity jsonPredicate)
Determines the type of the property (object or datatype property). |
static PropertyFactory |
get()
The static getter for the singleton |
private void |
initializeProperty(info.sswap.api.model.SSWAPPredicate predicate,
Entity jsonPredicate)
Initializes an empty SSWAPPredicate during its creation process. |
private void |
initializePropertyTypes(info.sswap.api.model.SSWAPPredicate predicate,
Entity jsonPredicate,
PropertyFactory.PropertyType propertyType)
Initializes property definition with type information (via rdf:type statements) based on the information explicitly declared in the JSON definition and type information guessed from the heuristics. |
private PropertyFactory.PropertyType |
processAnonymousRangeDefinition(Entity rangeDef)
Processes an anonymous range definition in an attempt to detect the type of the property. |
private PropertyFactory.PropertyType |
processRangeAssertions(Entity jsonPredicate,
PropertyFactory.PropertyType propertyType)
Processes the rdfs:range definitions in JSON in order to determine whether the property is a datatype or an object property. |
private PropertyFactory.PropertyType |
processSubPropertyOfAssertions(info.sswap.api.model.SSWAPPredicate predicate,
Entity jsonPredicate,
PropertyFactory.PropertyType propertyType)
|
private PropertyFactory.PropertyType |
processTypeAssertions(Entity jsonPredicate)
Processes the rdf:type definitions in JSON in order to determine whether the property is a datatype or an object property |
Methods inherited from class info.sswap.http.rest.DefinitionFactoryBase |
---|
createURICollection, getString, getValuesAsLiteralCollection, getValuesAsPropertyValues, getValuesAsStringCollection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static PropertyFactory instance
Constructor Detail |
---|
private PropertyFactory()
Method Detail |
---|
public static PropertyFactory get()
public info.sswap.api.model.SSWAPPredicate createPredicate(info.sswap.api.model.SSWAPDocument document, Entity jsonProperty) throws java.lang.IllegalArgumentException
document
- the SSWAPDocument where the definition should be createdjsonProperty
- the JSON entity intermediate representation that describes the property
java.lang.IllegalArgumentException
- on "anonymous" properties and invalid URIsprivate void initializeProperty(info.sswap.api.model.SSWAPPredicate predicate, Entity jsonPredicate) throws java.lang.IllegalArgumentException
predicate
- the property definition being intializedjsonPredicate
- the JSON description of the property
java.lang.IllegalArgumentException
private void initializePropertyTypes(info.sswap.api.model.SSWAPPredicate predicate, Entity jsonPredicate, PropertyFactory.PropertyType propertyType) throws java.lang.IllegalArgumentException
predicate
- the property definition to be initialized with type informationjsonPredicate
- the JSON definition of the propertypropertyType
- the determined property type (either by analyzing explicit type information or by applying heuristics)
java.lang.IllegalArgumentException
private PropertyFactory.PropertyType determinePropertyType(info.sswap.api.model.SSWAPPredicate predicate, Entity jsonPredicate)
jsonPredicate
- the JSON definition of the property
private PropertyFactory.PropertyType processTypeAssertions(Entity jsonPredicate)
jsonPredicate
- the JSON property definition
java.lang.IllegalArgumentException
- if the JSON description declares the property to be
both Object and Datatype propertyprivate PropertyFactory.PropertyType processSubPropertyOfAssertions(info.sswap.api.model.SSWAPPredicate predicate, Entity jsonPredicate, PropertyFactory.PropertyType propertyType)
private PropertyFactory.PropertyType processRangeAssertions(Entity jsonPredicate, PropertyFactory.PropertyType propertyType)
jsonPredicate
- the JSON property definition
private PropertyFactory.PropertyType processAnonymousRangeDefinition(Entity rangeDef)
rangeDef
- the anonymous range definition
private java.util.Collection<info.sswap.api.model.SSWAPPredicate> createEmptyProperties(info.sswap.api.model.SSWAPDocument document, Value value) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
private info.sswap.api.model.SSWAPPredicate createEmptyProperty(info.sswap.api.model.SSWAPDocument document, Value value) throws java.lang.IllegalArgumentException
document
- the SSWAPDocument which should contain the property definitionvalue
- the value describing the URI (must be a literal)
java.lang.IllegalArgumentException
- on "anonymous" properties and invalid URIsprivate java.util.Collection<info.sswap.api.model.SSWAPDatatype> createDatatypes(info.sswap.api.model.SSWAPDocument document, Value value) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
private info.sswap.api.model.SSWAPDatatype createDatatype(info.sswap.api.model.SSWAPDocument document, Value value) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
private info.sswap.api.model.SSWAPDatatype createComplexDatatype(info.sswap.api.model.SSWAPDocument document, Entity value) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |