Package org.aksw.limes.core.io.cache
Class Instance
- java.lang.Object
-
- org.aksw.limes.core.io.cache.Instance
-
- All Implemented Interfaces:
Serializable,Comparable<Object>
public class Instance extends Object implements Comparable<Object>, Serializable
Contains all the data related to a particular URI, i.e., all the (s p o) statements where s is a particular URI. From the point of view of linking, it an instance contains all the data linked to a particular instance ;)- Version:
- Jul 12, 2016
- Author:
- Axel-C. Ngonga Ngomo (ngonga@informatik.uni-leipzig.de), Mohamed Sherif (sherif@informatik.uni-leipzig.de)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description doubledistance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(String propUri, String value)Add a new (property, value) pairvoidaddProperty(String propUri, TreeSet<String> values)intcompareTo(Object o)Comparison with other InstancesInstancecopy()booleanequals(Object obj)Set<String>getAllProperties()Returns all the properties associated with this instanceTreeSet<String>getProperty(String propUri)Return all the values for a given propertyStringgetUri()Returns the URI of this instanceinthashCode()voidremovePropery(String uri)Removes property with URI uri from this InstancevoidreplaceProperty(String propUri, TreeSet<String> values)StringtoString()
-
-
-
Constructor Detail
-
Instance
public Instance(String _uri)
Constructor- Parameters:
_uri- URI of the instance. This is the key to accessing it.
-
-
Method Detail
-
addProperty
public void addProperty(String propUri, String value)
Add a new (property, value) pair- Parameters:
propUri- URI of the propertyvalue- value of the property for this instance
-
getUri
public String getUri()
Returns the URI of this instance- Returns:
- URI of this instance
-
getProperty
public TreeSet<String> getProperty(String propUri)
Return all the values for a given property- Parameters:
propUri- property URI- Returns:
- TreeSet of values associated with this URI
-
getAllProperties
public Set<String> getAllProperties()
Returns all the properties associated with this instance- Returns:
- A set of property Uris
-
compareTo
public int compareTo(Object o)
Comparison with other Instances- Specified by:
compareToin interfaceComparable<Object>- Parameters:
o- Instance for comparison- Returns:
- 1 if the distance from the exemplar to the current instance is smaller than the distance from the exemplar to o.
-
copy
public Instance copy()
-
removePropery
public void removePropery(String uri)
Removes property with URI uri from this Instance- Parameters:
uri- of the property to be removed
-
-