Class 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 Detail

      • distance

        public double distance
    • 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 property
        value - 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:
        compareTo in interface Comparable<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.
      • removePropery

        public void removePropery​(String uri)
        Removes property with URI uri from this Instance
        Parameters:
        uri - of the property to be removed
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object