uk.ac.open.kmi.skos
Class SKOSParser

java.lang.Object
  extended byuk.ac.open.kmi.skos.SKOSParser
Direct Known Subclasses:
SKOSChunkParser

public class SKOSParser
extends java.lang.Object

SKOSParser is a basic parser for the SKOS. It parses the whole SKOS into one OWLOntology


Field Summary
protected  java.lang.String language
           
 
Constructor Summary
SKOSParser()
          Constructor of the parser
SKOSParser(java.lang.String language)
          Constructor of the parser
 
Method Summary
protected  java.lang.String getBaseURI(java.lang.String fileName)
          Get the base URI from the SKOS.
protected  SKOSConcept getConcept(javax.xml.stream.XMLStreamReader reader)
          Get the whole Concept tag from the SKOS file
protected  SKOSConcept getDutchRDFDescription(javax.xml.stream.XMLStreamReader reader)
          Get the whole Description tag from the RDF file.
protected  SKOSConcept getRDFDescription(javax.xml.stream.XMLStreamReader reader)
          Get the whole Description tag from the RDF file.
 org.semanticweb.owl.model.OWLOntology parse(java.lang.String fileName)
          Parses the SKOS file and creates an OWLOntology
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

language

protected java.lang.String language
Constructor Detail

SKOSParser

public SKOSParser()
Constructor of the parser


SKOSParser

public SKOSParser(java.lang.String language)
Constructor of the parser

Parameters:
language - xml:lang tags that will be loaded into the ontology
Method Detail

parse

public org.semanticweb.owl.model.OWLOntology parse(java.lang.String fileName)
                                            throws SKOSParserException
Parses the SKOS file and creates an OWLOntology

Parameters:
fileName -
Returns:
OWLOntology
Throws:
SKOSParserException

getBaseURI

protected java.lang.String getBaseURI(java.lang.String fileName)
                               throws SKOSParserException
Get the base URI from the SKOS. e.g. http://agclass.nal.usda.gov/nalt/2007.xml GEMET http://www.eionet.europa.eu/gemet/concept/8 GTT http://stitch.cs.vu.nl/gtt#gtt_145844706

Parameters:
fileName - SKOS filename
Returns:
String
Throws:
SKOSParserException

getConcept

protected SKOSConcept getConcept(javax.xml.stream.XMLStreamReader reader)
                          throws SKOSParserException
Get the whole Concept tag from the SKOS file

Parameters:
reader - XMLStreamReader
Returns:
SKOSConcept
Throws:
SKOSParserException

getDutchRDFDescription

protected SKOSConcept getDutchRDFDescription(javax.xml.stream.XMLStreamReader reader)
                                      throws SKOSParserException
Get the whole Description tag from the RDF file. The labels for the library skos are in Dutch.

Parameters:
reader - XMLStreamReader
Returns:
SKOSConcept or noll it it is not a concept tag.
Throws:
SKOSParserException

getRDFDescription

protected SKOSConcept getRDFDescription(javax.xml.stream.XMLStreamReader reader)
                                 throws SKOSParserException
Get the whole Description tag from the RDF file. The labels for the environment skos are dependent on the language version of the file.

Parameters:
reader - XMLStreamReader
Returns:
SKOSConcept
Throws:
SKOSParserException