All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.semanticweb.elk.reasoner.taxonomy.model.UpdateableInstanceTaxonomy Maven / Gradle / Ivy

There is a newer version: 0.29.0
Show newest version
/*
 * #%L
 * ELK Reasoner
 * $Id:$
 * $HeadURL:$
 * %%
 * Copyright (C) 2011 - 2012 Department of Computer Science, University of Oxford
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package org.semanticweb.elk.reasoner.taxonomy.model;

import java.util.Collection;
import java.util.Set;

import org.semanticweb.elk.owl.interfaces.ElkEntity;

/**
 * Updateable instance taxonomy. Extends the functionality of
 * {@link UpdateableTaxonomy} to type nodes and instance nodes.
 * 
 * @author Pavel Klinov
 *
 *         [email protected]
 * @author Peter Skocovsky
 *
 * @param 
 *            The type of members of the type nodes in this taxonomy.
 * @param 
 *            The type of members of the instance nodes in this taxonomy.
 */
public interface UpdateableInstanceTaxonomy
		extends InstanceTaxonomy, UpdateableTaxonomy {

	@Override
	NonBottomTypeNode getNonBottomNode(T elkEntity);

	@Override
	Set> getNonBottomNodes();

	@Override
	NonBottomTypeNode getCreateNode(Collection members);

	/**
	 * Returns the instance node that contains the members provided in
	 * arguments. If such a node is not in this taxonomy, it is created and
	 * inserted into this taxonomy.
	 * 
	 * @param instances
	 *            The members of the returned node.
	 * @return The instance node containing the provided members.
	 */
	InstanceNode getCreateInstanceNode(Collection instances);

	/**
	 * Associates type nodes containing the specified members with the supplied
	 * instance node. If the type nodes do not exist, they are created.
	 * 
	 * TODO: More consistent contract and concurrency!
	 * 
	 * @param instanceNode
	 *            The node with which the type nodes are to be associated.
	 * @param typeSets
	 *            A collection of collections that should be the members of the
	 *            type nodes.
	 * @return true iff the job was successfully finished by the
	 *         current thread.
	 */
	boolean setCreateDirectTypes(InstanceNode instanceNode,
			Iterable> typeSets);

	/**
	 * Removes the association between the supplied instance node and its type
	 * nodes.
	 * 
	 * @param instanceNode
	 *            The node whose association with type nodes should be removed.
	 * @return true iff the job was successfully finished by the
	 *         current thread.
	 */
	boolean removeDirectTypes(InstanceNode instanceNode);

	/**
	 * Removes the instance node containing the specified member from the
	 * taxonomy.
	 * 
	 * @param instance
	 *            the instance member of the node to be removed
	 * @return true if and only if some node was removed.
	 */
	boolean removeInstanceNode(I instance);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy