Class UsageKnowledge
java.lang.Object
org.gcube.informationsystem.discovery.knowledge.UsageKnowledge
A class that stores and manages knowledge about the usage of linked entities
within the model.
It maintains a map where keys are type names (source, relation, or target)
and values are sets of LinkedEntity objects that use that type.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,Set<LinkedEntity>> A map from type names to the set of linked entities that use them. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadd(String typeName, LinkedEntity linkedEntity) Adds a linked entity to the usage map for a specific type name.voidadd(LinkedEntity linkedEntity) Adds a linked entity to the knowledge base, indexing it by its source, relation, and target types.voidaddAll(Collection<LinkedEntity> linkedEntities) Adds a collection of linked entities to the knowledge base.Returns the set of linked entities that use a specific type.
-
Field Details
-
map
A map from type names to the set of linked entities that use them.
-
-
Constructor Details
-
UsageKnowledge
public UsageKnowledge()Default constructor. Initializes the usage map.
-
-
Method Details
-
add
Adds a linked entity to the usage map for a specific type name.- Parameters:
typeName- The type name (source, relation, or target).linkedEntity- The linked entity to add.
-
add
Adds a linked entity to the knowledge base, indexing it by its source, relation, and target types.- Parameters:
linkedEntity- The linked entity to add.
-
addAll
Adds a collection of linked entities to the knowledge base.- Parameters:
linkedEntities- The collection of linked entities to add.
-
getUsage
Returns the set of linked entities that use a specific type.- Parameters:
typeName- The name of the type.- Returns:
- A set of
LinkedEntityobjects, ornullif the type is not found.
-