Class ModelKnowledge<T,TI extends TypeInformation<T>>
java.lang.Object
org.gcube.informationsystem.model.knowledge.ModelKnowledge<T,TI>
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<AccessType,UsageKnowledge<LinkedEntity>> The entity/relation types usage.protected Map<String,AccessType> A map to locate types.protected UsageKnowledge<Map.Entry<String,PropertyDefinition>> The property usage.protected Map<AccessType,Tree<T>> The trees of types.protected TIThe type information. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllType(Collection<T> types) Adds all types to the knowledge base.protected voidaddAllUsage(Collection<LinkedEntity> linkedEntities, UsageKnowledge<LinkedEntity> relationUsage, UsageKnowledge<LinkedEntity> targetEntityUsage) Adds all usages of a collection of linked entities.protected voidAdds the entity metadata usage for a type.protected voidAdds the propagation constraint usage for a type.protected voidaddPropertyUsage(T t, Set<PropertyDefinition> properties) Adds the property usage for a type.protected voidAdds the relation metadata usage for a type.voidAdds a type to the knowledge base.protected voidaddUsage(LinkedEntity linkedEntity, UsageKnowledge<LinkedEntity> relationUsage, UsageKnowledge<LinkedEntity> targetEntityUsage) Adds a usage of a linked entity.Returns the "consists of" usage.getERTypesUsage(AccessType accessType) Returns the usage knowledge for the given entity/relation type.Returns the facet usage.Returns the "is related to" usage.getModelTypesUsage(AccessType accessType) Returns the usage knowledge for the given model type.getNodeByName(String typeName) Return the node for the type if it is contained in the KnowledgeReturns the property usage.Returns the resource usage.getTree(AccessType accessType) Returns the tree for the given access type.getTypeByName(String typeName) Return the type if it is contained in the Knowledgeprotected voidreset()Resets the knowledge base.
-
Field Details
-
typeInformation
The type information. -
trees
The trees of types. -
propertyUsage
The property usage. -
erTypesUsage
The entity/relation types usage. -
locate
A map to locate types.
-
-
Constructor Details
-
ModelKnowledge
Creates a new instance.- Parameters:
typeInformation- The type information.
-
-
Method Details
-
reset
protected void reset()Resets the knowledge base. -
addUsage
protected void addUsage(LinkedEntity linkedEntity, UsageKnowledge<LinkedEntity> relationUsage, UsageKnowledge<LinkedEntity> targetEntityUsage) Adds a usage of a linked entity.- Parameters:
linkedEntity- The linked entity.relationUsage- The relation usage.targetEntityUsage- The target entity usage.
-
addAllUsage
protected void addAllUsage(Collection<LinkedEntity> linkedEntities, UsageKnowledge<LinkedEntity> relationUsage, UsageKnowledge<LinkedEntity> targetEntityUsage) Adds all usages of a collection of linked entities.- Parameters:
linkedEntities- The linked entities.relationUsage- The relation usage.targetEntityUsage- The target entity usage.
-
addPropertyUsage
Adds the property usage for a type.- Parameters:
t- The type.properties- The properties.
-
addEntityMetadataUsage
Adds the entity metadata usage for a type.- Parameters:
t- The type.
-
addRelationMetadataUsage
Adds the relation metadata usage for a type.- Parameters:
t- The type.
-
addPropagationConstraintUsage
Adds the propagation constraint usage for a type.- Parameters:
t- The type.
-
addAllType
Adds all types to the knowledge base.- Parameters:
types- The types to add.
-
addType
Adds a type to the knowledge base.- Parameters:
t- The type to add.
-
getTree
Returns the tree for the given access type.- Parameters:
accessType- The access type.- Returns:
- The tree.
-
getModelTypesUsage
Returns the usage knowledge for the given model type.- Parameters:
accessType- The access type.- Returns:
- The usage knowledge.
-
getERTypesUsage
Returns the usage knowledge for the given entity/relation type.- Parameters:
accessType- The access type.- Returns:
- The usage knowledge.
-
getPropertyUsage
Returns the property usage.- Returns:
- The property usage.
-
getResourceUsage
Returns the resource usage.- Returns:
- The resource usage.
-
getFacetUsage
Returns the facet usage.- Returns:
- The facet usage.
-
getIsRelatedToUsage
Returns the "is related to" usage.- Returns:
- The "is related to" usage.
-
getConsistsOfUsage
Returns the "consists of" usage.- Returns:
- The "consists of" usage.
-
getTypeByName
Return the type if it is contained in the Knowledge- Parameters:
typeName- the type we are looking for- Returns:
- the Type
- Throws:
RuntimeException- if the type is not found.
-
getNodeByName
Return the node for the type if it is contained in the Knowledge- Parameters:
typeName- the type we are looking for- Returns:
- the Type
- Throws:
RuntimeException- if the type is not found.
-