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

gate.creole.ontology.OntologyTripleStore Maven / Gradle / Ivy

Go to download

GATE - general achitecture for text engineering - is open source software capable of solving almost any text processing problem. This artifact enables you to embed the core GATE Embedded with its essential dependencies. You will able to use the GATE Embedded API and load and store GATE XML documents. This artifact is the perfect dependency for CREOLE plugins or for applications that need to customize the GATE dependencies due to confict with their own dependencies or for lower footprint.

The newest version!
/*
 *  Copyright (c) 1995-2012, The University of Sheffield. See the file
 *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
 *
 *  This file is part of GATE (see http://gate.ac.uk/), and is free
 *  software, licenced under the GNU Library General Public License,
 *  Version 2, June 1991 (in the distribution as file licence.html,
 *  and also available at http://gate.ac.uk/gate/licence.html).
 *
 *  Johann Petrak
 *
 *  $Id: $
 */
package gate.creole.ontology;

/**
 * An OntologyTripleStore object can be used to directly manipulate the
 * triples that represent an ontology, if the ontology implementation 
 * supports this. The OntologyTripleStore object can be accessed using
 * the method {@link Ontology#getOntologyTripleStore}.
 * 
 * @author Johann Petrak
 */
public interface OntologyTripleStore {
  /** 
   * Add a triple with a non-literal triple object to the triple store. 
   *
   * @param subject 
   * @param predicate
   * @param object 
   */
  public void addTriple(ONodeID subject, OURI predicate, ONodeID object);
  
  /** 
   * Add a triple with a literal triple object to the triple store. 
   *
   * @param subject
   * @param predicate
   * @param object 
   */
  public void addTriple(ONodeID subject, OURI predicate, Literal object);
  
  /** 
   * Remove a statement(triple) with a non-literal triple object 
   * from the ontology triple
   * store. The null value can be used for any of the subject, predicate,
   * or object parameters as a wildcard indicator: in that case, triples
   * with any value for that parameter will be removed.
   * 
   * NOTE: if a null value is passed for the object parameter, triples with
   * any value for the object, no matter if it is a literal or non-literal
   * (including blank nodes) will be removed!!
   * 
   * @param subject
   * @param predicate
   * @param object 
   */
  public void removeTriple(ONodeID subject, OURI predicate, ONodeID object);
  /** 
   * Remove a statement(triple) with a literal triple object from the ontology triple
   * store. The null value can be used for any of the subject, predicate,
   * or object parameters as a wildcard indicator: in that case, triples
   * with any value for that parameter will be removed.
   * 
   * NOTE: if a null value is passed for the object parameter, triples with
   * any value for the object, no matter if it is a literal or non-literal
   * (including blank nodes) will be removed!!
   * 
   * @param subject
   * @param predicate
   * @param object 
   */
  public void removeTriple(ONodeID subject, OURI predicate, Literal object);

  /** 
   * Add a listener for ontology triple store additions and removals. 
   * The listener will get the parameters of the original addition or 
   * deletion request, not any indication of which concrete triples were 
   * actually added or removed!
   * 

* NOTE: the listener will not get all events for modifications made * through methods other than the direct triple addition and removal * methods of the OntologyTripleStore object. * * @param listener OntologyTripleStoreListener object */ public void addOntologyTripleStoreListener( OntologyTripleStoreListener listener); /** * Check if a given triple with an URI object is part of the ontology. * * @param subject * @param predicate * @param object * @return true if the triple with the given subject, predicate and object * is either asserted or inferred in the ontology. */ public boolean hasTriple(ONodeID subject, OURI predicate, ONodeID object); /** * Check if a given triple with a literal object is part of the ontology. * * @param subject * @param predicate * @param object * @return true if the triple with the given subject, predicate and object * is either asserted or inferred in the ontology. */ public boolean hasTriple(ONodeID subject, OURI predicate, gate.creole.ontology.Literal object); /** * Remove an existing listener for ontology triple store additions and removals. * * @param listener OntologyTripleStoreListener object */ public void removeOntologyTripleStoreListener( OntologyTripleStoreListener listener); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy