AbstractItem Constructor Detail public AbstractItem(AbstractItem another) A constructor for this class. Parameters: another - An AbstractItem to clone. AbstractItem public AbstractItem(MuseumModel model, Id id) A constructor for this class. Parameters: model - The MuseumModel this AbstractItem belongs to.id - The identifier for this AbstractItem. ---------------------------- CompositeId protected java.util.Collection ids The actual compostition if Id-objects. ID_SEPARATOR public java.lang.String ID_SEPARATOR Constructor Detail public CompositeId(java.util.Collection ids) A constructor for the class. Parameters: ids - A CompositeId-object to clone. CompositeId public CompositeId(Id id1, Id id2) A constructor for the class. Parameters: id1 - An Id-object to add to the composition.id2 - An Id-object to add to the composition. Method Detail public java.lang.String getId() Returns the id as a String value. Specified by: getId in interface Id Returns: The id as a String value. public Id getId(int number) Returns the id at position 'number'. Parameters: number - The position of the id to return.Returns: The specified Id. public java.lang.String getString() Returns the id as a String value. Specified by: getString in interface Id Returns: The id as a String value. public int compareTo(java.lang.Object anotherId) throws java.lang.ClassCastException Implements the Comparable interface. Specified by: compareTo in interface java.lang.Comparable public java.lang.String toString() Returns the id as a String value. Overrides: toString in class java.lang.Object Returns: The id as a String value. ---------------------------- ConcreteItem public ConcreteItem(ConcreteItem another) A constructor for this class. Parameters: another - A ConcreteItem to clone. ConcreteItem public ConcreteItem(MuseumModel model, Id id) A constructor for this class. Parameters: model - The MuseumModel this ConcreteItem belongs to.id - The identifier for this ConcreteItem. ---------------------------- Id public java.lang.String getId() Returns a string respresentation of an Id. public java.lang.String getString() Returns a string respresentation of an Id. ---------------------------- Image protected static java.util.Hashtable predefinedPropertyHash Constructor Detail public Image(Image another) A constructor for the Image-object Parameters: another - Another Image-object to clone. Image public Image(MuseumModel model, Id id) A constructor for the Image-object Parameters: model - The parent model for this image.id - An Id-object for this image. Method Detail public java.util.Hashtable getPredefinedProperties() Properties that are predefined as methods in this class. Overrides: getPredefinedProperties in class OntologyResource Returns: A Map-object holding the predefined properties of this ontology resource. public java.lang.String getDescription() Returns the string description as definded by the dublic core dc:Description-tag. Returns: A string description of the image. public java.lang.String getSubject() Returns the string description as definded by the dublic core dc:Subject-tag. Will probebly not be implemented now... Returns: A string subject of the image. public java.lang.String getLabel() Returns the label of this image. Overrides: getLabel in class OntologyResource Returns: A string holding the label of the image. public ResourceCollection getImageFiles() Returns the ImageFile-objects associated with this image. Returns: A ResourceCollection-object holding the ImageFile-objects associated with this image. This should really be improved. public ResourceCollection getInstancesForClass(OntologyClass oclass) Returns the instances linked to this image and directly to the specified ontology class. Parameters: oclass - The OntologyClass to which the returned instaces must belong.Returns: A ResourceCollection-object holding the Image-objects for the images linked to this instance. public boolean addFileStatements() Adds a base ImageFile of this Image to the Imagefile ontology. This should really be improved. Returns: True if the operation succeeded. ---------------------------- ImageFile public static final java.lang.String ID public static final java.lang.String HEIGHT public static final java.lang.String WIDTH public static final java.lang.String COLOUR public static final java.lang.String FILENAME public static final java.lang.String BASE_URL public static final java.lang.String FORMAT public static final java.lang.String ID_SUFFIX protected static java.util.Hashtable predefinedPropertyHash Constructor Detail public ImageFile(ImageFile another) Constructor for the class. Makes copy of another ImageFile. Parameters: another - The ImageFile to be copied. public ImageFile(MuseumModel model, OntologyResource parent, Id id) Another constructor for this class. Parameters: model - The model to which this class belongs to.parent - The Image to which this class belongs to.id - The identifier of this class. Method Detail public java.util.Hashtable getPredefinedProperties() Properties that are predefined as methods in this class. Overrides: getPredefinedProperties in class Image Returns: A Map-object holding the predefined properties of this ontology resource. public java.lang.String getColour() Returns the colour information of the imagefile. Returns: A String holding the colour information of the imagefile. public java.lang.String getFileName() Returns the filename of the imagefile. Returns: A String holding the filename of the imagefile. public java.lang.String getBaseURL() Returns the base URL of the imagefile. Returns: A String holding the base URL of the imagefile. public java.net.URL getURL() Returns the URL of the imagefile. Overrides: getURL in class OntologyResource Returns: An URL-object holding the URL of the imagefile. public java.lang.String getFormat() Returns the image format information of the imagefile. Returns: A String holding the image format information of the imagefile. public int getHeight() Returns the height (in pixels) of the imagefile. Returns: A String holding the height (in pixels) of the imagefile. public Id getImageId() Returns the id of the image this imagefile belongs to. Returns: A String holding the id of the image this imagefile belongs to. protected java.awt.Dimension getSize() Retrieves the size of this ImageFile and saves it. Returns: A Dimension-object holding the height and width of this ImageFile. public int getWidth() Returns the width (in pixels) of the imagefile. Returns: A String holding the width (in pixels) of the imagefile. ---------------------------- Instance protected OntologyClass type public Instance(MuseumModel model, Id id) public Instance(MuseumModel model, OntologyClass type, Id id) Method Detail public OntologyClass getType() Returns the OntologyClass-object(s) this object is an instance of. public ResourceCollection getImages() Returns the images linked to this instance. Returns: A ResourceCollection-object holding the Image-objects for the images linked to this instance. public long getImageCount() Returns the number of images linked to an instance. Returns: A long value holding the number of images linked to this ontology class. public java.lang.String getLabel() Gives the label of this instance. Overrides: getLabel in class OntologyResource Returns: value of the MuseumModel.INSTANCELABEL_PREDICATE-property of this instance. ---------------------------- Item public Item(Item another) A constructor for this class. Parameters: another - An Item to clone. public Item(MuseumModel model, Id id) A constructor for this class. Parameters: model - The MuseumModel this Item belongs to.id - The identifier for this Item. ---------------------------- MuseumModel public static final java.lang.String TYPE_PROPERTY_URI public static final java.lang.String LABEL_PROPERTY_URI public static final java.lang.String SUBCLASSOF_PROPERTY_URI public static final java.lang.String WEIGHT_ID_PROPERTY_URI public static final java.lang.String WEIGHT_COUNT_PROPERTY_URI public static final java.lang.String RESOURCE_CLASS_URI public static final java.lang.String RESOURCE_WEIGHT_URI public static final java.lang.String BASE_NS public static final java.lang.String WEIGHT_NS public static final java.lang.String IMFILE_NS public static final java.lang.String FACETNAME_PREDICATE public static final java.lang.String INSTANCELABEL_PREDICATE public static final java.lang.String NAME_PREFIX public static final java.lang.String INSTANCE_PREFIX public static final java.lang.String IMAGE_PREFIX public static final java.lang.String WEIGHT_SUFFIX public static final java.lang.String IMAGE_PROTOCOL public static final java.lang.String DC_DESCRIPTION public static final java.lang.String DC_SUBJECT public static final java.lang.String IMAGE_PATH Constructor Detail public MuseumModel(java.net.URL baseURL, java.lang.String basePath) Constructor for the object model Parameters: baseURL - Base URL for the application.basePath - Path where to find the files related to the model. Method Detail public boolean readModel() Creates the model by reading RDF documents from the disk. Returns: True if the reading succeeded. public boolean writeModel() Writes the weight- and imagefile-models to disk. Returns: True if the write succeeded. public ResourceCollection getFacetRoots() throws com.hp.hpl.mesa.rdf.jena.model.RDFException Returns the facets of the main ontology according to the facet ontology. Returns: A Collection-object holding OntologyClass-objects of the facet roots. public java.util.Collection getPopularImages(int numberOfImages) Returns the (at maximum) n most popular images. Parameters: numberOfImages - The maximum number of images to return.Returns: A Collection-object holding Image-objects of the images. public ResourceCollection getPopularFacets(int numberOfFacets) Returns the (at maximum) n most popular facets. Specify a negative value to get all facets. Parameters: numberOfFacets - The maximum number of facets to return.Returns: A Collection-object holding OntologyClass-objects of the facets. public OntologyClass getOntologyClass(Id classId) Returns an ontology class by its id. Parameters: code - The id of the class to return.Returns: An OntologyClass-object of the class. public Image getImage(Id imageId) Returns an image class by its name. Parameters: code - The code of the image to return.Returns: An Image-object of the image. public long getImagePropertyWeightMaximum() Returns the weight of the most popular image property in the model. Returns: A long value holding the weight of the most popular image property. public long setImagePropertyWeightMaximum(long count) Sets the weight of the most popular image property in the model. Parameters: count - A long value holding the new maximum weight value.Returns: A long value holding the weight of the most popular image property. public long getImageWeightMaximum() Returns the weight of the most popular image in the model. Returns: A long value holding the weight of the most popular image. public long setImageWeightMaximum(long count) Sets the weight of the most popular image in the model. Parameters: count - A long value holding the new maximum weight value.Returns: A long value holding the weight of the most popular image. public long getClassWeightMaximum() Returns the weight of the most popular ontology class in the model. Returns: A long-value holding the weight of the most popular ontology class. public long setClassWeightMaximum(long count) Sets the weight of the most popular image in the model. Parameters: count - A long-value holding the new maximum weight value.Returns: A long-value holding the weight of the most popular ontology class. public java.lang.String getBasePath() Returns the base path of the model. Returns: A String-object holding the base path of this model. public java.net.URL getBaseURL() Returns the base URL of the model. Returns: An URL-object holding the base URL of this model. public com.hp.hpl.mesa.rdf.jena.model.Model getBaseModel() Returns the base model this class wraps. Returns: A Model-object holding the base model this class wraps. public com.hp.hpl.mesa.rdf.jena.model.Model getWeightModel() Returns the weight-model in this class. Returns: A Model-object holding the weight-model in this class. public com.hp.hpl.mesa.rdf.jena.model.Model getImagefileModel() Returns the imagefile-model in this class. Returns: A Model-object holding the iamgefile-model in this class. public com.hp.hpl.mesa.rdf.jena.model.Model getFacetModel() Returns the facet-model in this class. Returns: A Model-object holding the facet-model in this class. public static java.lang.String encodeURI(java.lang.String stringToEncode) Wraps Jena's URIref.encode method. For details see http://www.w3.org/TR/charmod/#sec-URIs Parameters: stringToEncode - The string to encode.Returns: The encoded string. public static java.lang.String decodeURI(java.lang.String stringToDecode) Wraps Jena's URIref.decode method. For details see http://www.w3.org/TR/charmod/#sec-URIs Parameters: stringToEncode - The string to decode.Returns: The decoded string. public static void testSelector(com.hp.hpl.mesa.rdf.jena.common.SelectorImpl selector, com.hp.hpl.mesa.rdf.jena.model.Model model) Test method for selectors. Prints all resulting statements to System.out Parameters: selector - The selector to test.model - The jena model to test the selector in. ---------------------------- OntologyClass public static final int ALL public static final int DIRECT Constructor Detail public OntologyClass(OntologyClass another) Constructor for the OntologyClass class. Parameters: another - An OntologyClass-object to clone. public OntologyClass(MuseumModel model, Id id) Constructor for the OntologyClass class. Parameters: id - An Id-object holding the literal name of this ontology class.model - A MuseumModel-object holding the model this object is a part of. Method Detail public ResourceCollection getChildren(int depth) Returns the children of this ontology class and its subtree. Parameters: depth - An int value holding the depth of the subtree to traverse in order to find children of this ontology class. Specify DIRECT not search any subtree and ALL to search the entire subtree.Returns: A ResourceCollection-object holding the OntologyClass-objects of the children of this ontology-class and its depth-sized subtree. public ResourceCollection getParents(int depth) Returns the parents of this ontology class and its supertree. Parameters: depth - An int value holding the depth of the supertree to traverse in order to find parents of this ontology class. Specify DIRECT not search any supertree and ALL to search the entire supertree.Returns: A ResourceCollection-object holding the OntologyClass-objects of the parents of this ontology-class and its depth-sized supertree. public ResourceCollection getInstances(int depth) Returns the instances of this ontology class. Returns: A ResourceCollection-object holding the Instance-objects of the instances of this ontology-class and its depth-sized subtree. public ResourceCollection getImages(int depth) Returns the images linked to this ontology class through its instances. Parameters: depth - An int value holding the depth of the subtree to traverse in order to find images of this ontology class. Specify DIRECT not search any subtree and ALL to search the entire subtree.Returns: A ResourceCollection-object holding the images linked to this ontology class through its instances.See Also: Instance.getImages() public ResourceCollection getIntersectImages(java.util.Hashtable intersectImages, int depth) Intersects the images of this object with an existing intersection Parameters: intersectImages - A Hashtable-object holding the OntologyClass-objects of an intersection.depth - An int value holding the depth of the intersection.Returns: A ResourceCollection-object holding the intersected Image-objects. public long getImageCount() Returns the number of images linked to an ontology class. Returns: A long value holding the number of images linked to this ontology class. public java.lang.String getLabel() Returns the decoded name of this ontology class. Overrides: getLabel in class OntologyResource Returns: A Sting holding the decoded name of this ontology class. ---------------------------- OntologyElement Constructor Detail public OntologyElement(OntologyElement another) A constructor for the OntologyElement class. Parameters: another - An OntologyElement object to clone. public OntologyElement(MuseumModel model, Id id) A constructor for the OntologyElement class. Parameters: model - The parent MudeumModel of this object.id - The identifier for this object. ---------------------------- PropertyDefinition protected OntologyClass domain protected OntologyClass range Constructor Detail public PropertyDefinition(MuseumModel model, Id id) A constructor for the class. Parameters: model - The MuseumModel this PropertyDefinition belongs to.id - The id of this PropertyDefinition. public PropertyDefinition(MuseumModel model, OntologyClass range, OntologyClass domain, Id id) A constructor for the class with range and domain. Not in use. Parameters: model - The MuseumModel this PropertyDefinition belongs to.range - The range for this PropertyDefinition.domain - The domain for this PropertyDefinition.id - The id of this PropertyDefinition. Method Detail public OntologyClass getDomain() Returns the domain for this PropertyDefinition. Not in use. Returns: An OntologyClass-object representing the domain for this PropertyDefinition. public OntologyClass getRange() Returns the range for this PropertyDefinition. Not in use. Returns: An OntologyClass-object representing the range for this PropertyDefinition. ---------------------------- PropertyValue public static final java.lang.Class LITERAL public static final java.lang.Class INSTANCE public static final java.lang.Class INTEGER protected java.lang.Object value protected java.lang.Class type protected boolean isBag Constructor Detail public PropertyValue(java.lang.Object value, MuseumModel model) throws java.lang.ClassNotFoundException Constructs a new Property ant tries to figure out the value's type. Method Detail public Instance getInstance() throws java.lang.IllegalStateException Returns: The value this PropertyValue wraps or null if its type is not Instace. public int getInt() throws java.lang.IllegalStateException public java.lang.String getLiteral() Returns: The value this PropertyValue wraps or null if its type is not RDF literal. public java.lang.Class getType() Returns the type of the value this PropertyValue wraps. Returns: A Class-object holding the class the object this PropertyValue wraps is an instance of. public long getWeight() Overrides the getWeight()- method in OntologyResource since it is not sane to give weights to PropertyDefinition-objects. Give them to ResourceProperties instead. Calling this method will throw an exception. Overrides: getWeight in class OntologyResource Returns: Nothing. (But supposedly a long value)Throws: java.lang.UnsupportedOperationException - It is not sane to give weights to instances of this class.See Also: OntologyResource.getWeight() public java.lang.Object getValue() Returns the value this PropertyValue wraps. Returns: An Object holding the value this PropertyValue wraps. public boolean isComparable() Description copied from class: OntologyResourceImplements the Comparable interface. Overrides: isComparable in class OntologyResource Returns: True if the value this PropertyValue wraps implements Comparable. public boolean isBag() Returns: True if the value this PropertyValue wraps is an RDF bag. public boolean isInstance() Returns: True if the value this PropertyValue wraps is an Instance. public boolean isInt() public boolean isLiteral() Returns: True if the value this PropertyValue wraps is an RDF literal. public long addWeight() Overrides the addWeight()- method in OntologyResource since it is not sane to give weights to PropertyDefinition-objects. Give them to ResourceProperties instead. Calling this method will throw an exception Overrides: addWeight in class OntologyResource Returns: Nothing. (But supposedly a long value)Throws: java.lang.UnsupportedOperationException - It is not sane to give weights to instances of this class.See Also: OntologyResource.addWeight() ---------------------------- ResourceCollection Constructor Detail ResourceCollection protected ResourceCollection() A constructor for this class. Method Detail public java.util.Collection getCollection() Returns a collection holding all OntologyResources in this ResourceCollection by calling getList(). Returns: A collection holding all OntologyResources in this ResourceCollection. public java.util.LinkedList getList() Returns a linked list holding all OntologyResources in this ResourceCollection. Returns: A linked list holding all OntologyResources in this ResourceCollection. public boolean addAll(java.util.Collection resourceCollection) Adds the contents of another ResourceCollection to this ResourceCollection. Overrides: addAll in class java.util.AbstractCollection Parameters: resourceCollection - Another ResourceCollection to add to this ResourceCollection.Returns: True if the operation succeeded. protected abstract ResourceIterator getIterator() Returns a new ResourceIterator for this ResourceCollection. Returns: new ResourceIterator for this ResourceCollection or null if this ResourceCollection is empty. public java.util.Iterator iterator() Constructs an iterator for this ResourceCollection. If tail exists links it with this' iterator. Overrides: iterator in class java.util.AbstractCollection public int size() Returns the number of elements in this ResourceCollection. Overrides: size in class java.util.AbstractCollection Returns: An int value specifying the number of elements in this ResourceCollection. ---------------------------- protected ResourceIterator() Constructs an empty iterator. ResourceIterator protected ResourceIterator(ResourceProvider resourceProvider) Constructs a new ResourceIterator that uses resourceProvider to construct its elements. Parameters: resourceProvider - Used to constuct the elements of this iterator. Method Detail public void addIterator(ResourceIterator resourceIterator) Adds a new iterator to the tail of this iterator. Parameters: resourceIterator - Iterator to be added. public boolean hasNext() This method tries to figure out the next element, using hasNextHead() and getNext(). If getNext() returns null it will be called again until it returns not null object or hasNextHead() returns false. After consuming this iterator method continues to consume tail - if there is one. This method set's the attribute next. If resourceProvider is null the object is casted to OntologyResource. Specified by: hasNext in interface java.util.Iterator public java.lang.Object next() This method returns next. If there isn't anymore elements left this method returns null and closes this iterator and tail. Specified by: next in interface java.util.Iterator protected abstract java.lang.Object getNext() throws java.lang.Exception Returns the next element. Any filtering should be done here in the derived classes. protected abstract boolean hasNextHead() throws java.lang.Exception Checks if this iterator has more elements. protected abstract void closeHead() throws java.lang.Exception Closes this iterator by releasing any reserved resources. If this iterator is actually a ResultSet from a database query it is very important to close it here. public void close() Closes this iterator and linked iterators. protected void finalize() Closes this iterator and linked iterators. Overrides: finalize in class java.lang.Object public void remove() throws java.lang.UnsupportedOperationException, java.lang.IllegalStateException Unsupported operation. Specified by: remove in interface java.util.Iterator ---------------------------- protected java.lang.Object value Constructor Detail ResourceProperty public ResourceProperty(PropertyDefinition property, OntologyResource resource, java.lang.Object value, MuseumModel model) Constructs a new ResourceProperty. Parameters: property - The definition of this property.resource - The OntologyResource to which this ResourceProperty belongs.value - The value of this ResourceProperty.model - The MuseumModel this ResourceProperty belongs to. Method Detail public PropertyValue getValue() Returns the value of this ResourceProperty Returns: A PropertyValue-object holding the value of this property. public java.lang.String getLabel() Returns the label (human-readable literal) for this ResourceProperty Overrides: getLabel in class OntologyClass Returns: The label for this property. ---------------------------- ResourceProvider public OntologyResource getResource(java.lang.Object from) Returns: Returns null if the statement is hidden else requested OntologyResource constructed from the Statement. ---------------------------- SimpleId protected java.lang.String id The actual id. Constructor Detail public SimpleId(java.lang.String uri) A constructor for the class. Parameters: uri - An uri in String form to serve as the identifier for a ResourceCollection. Method Detail public java.lang.String getId() Returns the id as a String value. Specified by: getId in interface Id Returns: The id as a String value. public java.lang.String getString() Returns the id as a String value. Specified by: getString in interface Id Returns: The id as a String value. public boolean equals(java.lang.Object anotherId) Overrides: equals in class java.lang.Object public int compareTo(java.lang.Object anotherId) throws java.lang.ClassCastException Implements the Comparable interface. Specified by: compareTo in interface java.lang.Comparable public java.lang.String toString() Returns the id as a String value. Overrides: toString in class java.lang.Object Returns: The id as a String value. ---------------------------- SimpleResourceCollection public boolean add(java.lang.Object o) throws java.lang.ClassCastException, java.lang.UnsupportedOperationException, java.lang.NullPointerException, java.lang.IllegalArgumentException Adds o to this collection if resourceCollection supports add operation. o should be of type OntologyResource. Overrides: add in class java.util.AbstractCollection protected ResourceIterator getIterator() Description copied from class: ResourceCollectionReturns a new ResourceIterator for this ResourceCollection. Overrides: getIterator in class ResourceCollection Returns: Iterator (SimpleResourceIterator) for this collection.See Also: -------------------- SimpleResourceIterator public SimpleResourceIterator() Creates an empty iterator. SimpleResourceIterator public SimpleResourceIterator(java.util.Iterator iterator) Constructs SimpleResourceIterator that wraps iterator. Method Detail protected void closeHead() Does nothing. Overrides: closeHead in class ResourceIterator protected boolean hasNextHead() Description copied from class: ResourceIteratorChecks if this iterator has more elements. Overrides: hasNextHead in class ResourceIterator Returns: this.iterator.hasNext(). protected java.lang.Object getNext() Description copied from class: ResourceIteratorReturns the next element. Any filtering should be done here in the derived classes. Overrides: getNext in class ResourceIterator Returns: this.iterator.next(). ---------------------------- StatementResourceCollection protected com.hp.hpl.mesa.rdf.jena.model.Model model Jena's Model. resourceProvider protected ResourceProvider resourceProvider protected com.hp.hpl.mesa.rdf.jena.model.Selector selector Constructor Detail StatementResourceCollection public StatementResourceCollection() StatementResourceCollection public StatementResourceCollection(com.hp.hpl.mesa.rdf.jena.model.Model model, com.hp.hpl.mesa.rdf.jena.model.Selector selector, ResourceProvider resourceProvider) Method Detail protected ResourceIterator getIterator() Description copied from class: ResourceCollectionReturns a new ResourceIterator for this ResourceCollection. Overrides: getIterator in class ResourceCollection Following copied from class: fi.helsinki.w3m.metadata.ResourceCollection Returns: new ResourceIterator for this ResourceCollection or null if this ResourceCollection is empty. ---------------------------- StatementResourceIterator public StatementResourceIterator() StatementResourceIterator public StatementResourceIterator(com.hp.hpl.mesa.rdf.jena.model.StmtIterator iterator, ResourceProvider resourceProvider) Method Detail protected void closeHead() throws com.hp.hpl.mesa.rdf.jena.model.RDFException Description copied from class: ResourceIteratorCloses this iterator by releasing any reserved resources. If this iterator is actually a ResultSet from a database query it is very important to close it here. Overrides: closeHead in class ResourceIterator protected boolean hasNextHead() throws com.hp.hpl.mesa.rdf.jena.model.RDFException Description copied from class: ResourceIteratorChecks if this iterator has more elements. Overrides: hasNextHead in class ResourceIterator protected java.lang.Object getNext() throws com.hp.hpl.mesa.rdf.jena.model.RDFException Description copied from class: ResourceIteratorReturns the next element. Any filtering should be done here in the derived classes. Overrides: getNext in class ResourceIterator --------------------------- TestMuseumModel2 Constructor Detail public TestMuseumModel2() Method Detail public static void main(java.lang.String[] args)