project35.soa.ontology.sources
Class XMLOntologySource
java.lang.Object
project35.soa.ontology.sources.AbstractTreeOntologySource
project35.soa.ontology.sources.XMLOntologySource
- All Implemented Interfaces:
- java.io.Serializable, OntologySource, TreeOntologySource, ServiceClass
- Direct Known Subclasses:
- PictureOntologySource
public class XMLOntologySource
- extends AbstractTreeOntologySource
an ontology source that reads its terms from a bespoke XML format.
ontologyTerms
ontologyTerm
wordPhrase
definition
webPage
image
The "ontologyTerms" tag has attributes "identifier" and "relatedTerms" which
help this class organise the terms in a tree. "relatedTerms" takes a list of space
delimited identifiers that are found in the "identifier" attribute of other terms.
Copyright (c) 2008 Kevin Garwood for Project35. The original code was
developed by Kevin Garwood for the University of Manchester. Revisions
have been made for Project35, a project that is independent of that
institution. This code is licensed under the Academic Free License
version 3.0. The code attribution for the original code is included here:
Copyright (c) Kevin Garwood and University of Manchester 2007.
All rights reserved. Licensed under the Academic Free License
version 3.0. For more information on the terms and conditions,
please see the file "LICENSE" that is included in this distribution.
- Version:
- 1.0
- Author:
- Kevin Garwood (kgarwood@users.sourceforge.net)
- See Also:
- Serialized Form
Fields inherited from class project35.soa.ontology.sources.AbstractTreeOntologySource |
anchorTerms, collator, file, fileName, isSourceWorking, maskValidator, ontologyContext, parameters, resourceDirectory, rootTerm, searchResultTerm, status, url |
Methods inherited from class project35.soa.ontology.sources.AbstractTreeOntologySource |
addAnchorTerm, containsTerm, getInitialisationParameters, getOntologyServiceMetaData, getRelatedTerms, getSubOntologySource, getSupportedOntologyRelationships, getTerms, getTreeRoot, isWorking, reviseTreeWithAnchorTerms, search, search, setDescription, test |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
webPageFromIdentifier
protected java.util.Hashtable webPageFromIdentifier
definitionFromIdentifier
protected java.util.Hashtable definitionFromIdentifier
labelFromIdentifier
protected java.util.Hashtable labelFromIdentifier
ontologyTermFromIdentifier
protected java.util.Hashtable ontologyTermFromIdentifier
relatedTermsFromIdentifier
protected java.util.Hashtable relatedTermsFromIdentifier
imageFromIdentifier
protected java.util.Hashtable imageFromIdentifier
ontologyServiceMetaData
protected OntologyServiceMetaData ontologyServiceMetaData
XMLOntologySource
public XMLOntologySource()
load
public void load()
parseOntologyTerm
protected TreeOntologyTerm parseOntologyTerm(org.w3c.dom.Element ontologyDeclaration)
initialiseService
public void initialiseService(java.net.URL resourceDirectory,
Parameter[] parameters)
throws java.lang.Exception
- Specified by:
initialiseService
in interface ServiceClass
- Overrides:
initialiseService
in class AbstractTreeOntologySource
- Throws:
java.lang.Exception
getOntologyTermProvenance
public OntologyTermProvenance getOntologyTermProvenance(Project35FormContext project35FormContext,
OntologyTerm ontologyTerm)
- Specified by:
getOntologyTermProvenance
in interface OntologySource
- Specified by:
getOntologyTermProvenance
in class AbstractTreeOntologySource
getFieldValue
protected java.lang.String getFieldValue(org.w3c.dom.Element element)
- convenience routine for extracting the text value for an element
printTree
public void printTree(Project35FormContext project35FormContext,
int indentationLevel,
TreeOntologyTerm treeOntologyTerm)