eu.monnetproject.lemon
Interface LemonModel

All Known Implementing Classes:
LemonModelImpl

public interface LemonModel

Interface that contains a set of lexica and manages the URIs for all elements of the model. The seperation of URIs and the structure of the lemon model is intended to allow for models to be created quickly as individual elements frequently have stereotypical URIs.

Author:
John McCrae

Field Summary
static String LEMON_URI
          The URI for lemon
 
Method Summary
 Lexicon addLexicon(URI uri, String language)
          Add a (new blank) lexicon
 void addPattern(MorphPattern pattern)
          Add a pattern to the model
 URI getContext()
          Get the base URI of the model.
 LemonFactory getFactory()
          Get the factory for making new elements
 Collection<Lexicon> getLexica()
          Get the set of lexica contained by this model
 Collection<MorphPattern> getPatterns()
          Get all patterns now in the model
 void importLexicon(Lexicon lexicon, LinguisticOntology lingOnto)
          Import a lexicon from another model
<Elem extends LemonElement>
void
merge(Elem from, Elem to)
          Merge two elements
 void purgeLexicon(Lexicon lexicon, LinguisticOntology lingOnto)
          Remove a lexicon and all entries
<Elem extends LemonElementOrPredicate>
Iterator<Elem>
query(Class<Elem> target, String sparqlQuery)
          Return all elements in the lemon model matching some certain SPARQL query
 void removeLexicon(Lexicon lexicon)
          Remove a lexicon from the repository.
 

Field Detail

LEMON_URI

static final String LEMON_URI
The URI for lemon

See Also:
Constant Field Values
Method Detail

getLexica

Collection<Lexicon> getLexica()
Get the set of lexica contained by this model

Returns:
The set of lexica

getContext

URI getContext()
Get the base URI of the model. If this is not clear return the prefix of the first lexicon object

Returns:
The base URI, or null if the model has no context

getFactory

LemonFactory getFactory()
Get the factory for making new elements


addLexicon

Lexicon addLexicon(URI uri,
                   String language)
Add a (new blank) lexicon


removeLexicon

void removeLexicon(Lexicon lexicon)
Remove a lexicon from the repository. Note this does not remove any entries or other information contained in the lexicon, this must be done manually


purgeLexicon

void purgeLexicon(Lexicon lexicon,
                  LinguisticOntology lingOnto)
Remove a lexicon and all entries

Parameters:
lexicon - The lexicon
lingOnto - The linguistic ontology used for links in the lexicon. If this is incorrect it may result in links being followed that are not in the model resulting in to many entries being deleted

importLexicon

void importLexicon(Lexicon lexicon,
                   LinguisticOntology lingOnto)
Import a lexicon from another model

Parameters:
lexicon - The lexicon
lingOnto - The linguistic ontology used for links in the lexicon. If this is incorrect it may result in links being followed that are not in the model resulting in to many entries being imported

query

<Elem extends LemonElementOrPredicate> Iterator<Elem> query(Class<Elem> target,
                                                            String sparqlQuery)
Return all elements in the lemon model matching some certain SPARQL query

Parameters:
target - The class of the target
sparqlQuery - The query in sparql, must be a select query returning a single variable
Returns:
A Collection of elements matching the given query

merge

<Elem extends LemonElement> void merge(Elem from,
                                       Elem to)
Merge two elements

Parameters:
from - The element to be removed
to - The element to be preserved

addPattern

void addPattern(MorphPattern pattern)
Add a pattern to the model

Parameters:
pattern - The pattern

getPatterns

Collection<MorphPattern> getPatterns()
Get all patterns now in the model

Returns:
The set of patterns


Copyright © 2012. All Rights Reserved.