Class UsageKnowledge
- java.lang.Object
-
- org.gcube.informationsystem.discovery.knowledge.UsageKnowledge
-
public class UsageKnowledge extends Object
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
LinkedEntityobjects that use that type.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Set<LinkedEntity>>mapA map from type names to the set of linked entities that use them.
-
Constructor Summary
Constructors Constructor Description UsageKnowledge()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.Set<LinkedEntity>getUsage(String typeName)Returns the set of linked entities that use a specific type.
-
-
-
Field Detail
-
map
protected Map<String,Set<LinkedEntity>> map
A map from type names to the set of linked entities that use them.
-
-
Method Detail
-
add
protected void add(String typeName, LinkedEntity linkedEntity)
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
public void add(LinkedEntity linkedEntity)
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
public void addAll(Collection<LinkedEntity> linkedEntities)
Adds a collection of linked entities to the knowledge base.- Parameters:
linkedEntities- The collection of linked entities to add.
-
getUsage
public Set<LinkedEntity> getUsage(String typeName)
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.
-
-