org.coode.manchesterowlsyntax
Class ManchesterOWLSyntaxEditorParser
java.lang.Object
org.coode.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser
public class ManchesterOWLSyntaxEditorParser
- extends java.lang.Object
Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date:
10-Sep-2007
A parser for the Manchester OWL Syntax. All properties must be defined before they are used. For example, consider
the restriction hasPart some Leg. The parser must know in advance whether or not hasPart is an object property or a
data property so that Leg gets parsed correctly. In a tool, such as an editor, it is expected that hasPart will
already exists as either a data property or an object property. If a complete ontology is being parsed, it is
expected that hasPart will have been defined at the top of the file before it is used in any class descriptions or
property assertions (e.g. ObjectProperty: hasPart)
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AND
public static final java.lang.String AND
OR
public static final java.lang.String OR
INV
public static final java.lang.String INV
SOME
public static final java.lang.String SOME
SELF
public static final java.lang.String SELF
ONLY
public static final java.lang.String ONLY
VALUE
public static final java.lang.String VALUE
MIN
public static final java.lang.String MIN
MAX
public static final java.lang.String MAX
EXACTLY
public static final java.lang.String EXACTLY
ONLYSOME
public static final java.lang.String ONLYSOME
NOT
public static final java.lang.String NOT
CLASS
public static final java.lang.String CLASS
SUB_CLASS_OF
public static final java.lang.String SUB_CLASS_OF
EQUIVALENT_TO
public static final java.lang.String EQUIVALENT_TO
DISJOINT_WITH
public static final java.lang.String DISJOINT_WITH
DISJOINT_UNION_OF
public static final java.lang.String DISJOINT_UNION_OF
DISJOINT_CLASSES
public static final java.lang.String DISJOINT_CLASSES
DISJOINT_OBJECT_PROPERTIES
public static final java.lang.String DISJOINT_OBJECT_PROPERTIES
DISJOINT_DATA_PROPERTIES
public static final java.lang.String DISJOINT_DATA_PROPERTIES
OBJECT_PROPERTY
public static final java.lang.String OBJECT_PROPERTY
DATA_PROPERTY
public static final java.lang.String DATA_PROPERTY
SUB_PROPERTY_OF
public static final java.lang.String SUB_PROPERTY_OF
DOMAIN
public static final java.lang.String DOMAIN
RANGE
public static final java.lang.String RANGE
INVERSES
public static final java.lang.String INVERSES
CHARACTERISTICS
public static final java.lang.String CHARACTERISTICS
INDIVIDUAL
public static final java.lang.String INDIVIDUAL
ANNOTATIONS
public static final java.lang.String ANNOTATIONS
TYPES
public static final java.lang.String TYPES
FACTS
public static final java.lang.String FACTS
SAME_AS
public static final java.lang.String SAME_AS
SAME_INDIVIDUAL
public static final java.lang.String SAME_INDIVIDUAL
DIFFERENT_FROM
public static final java.lang.String DIFFERENT_FROM
DIFFERENT_INDIVIDUALS
public static final java.lang.String DIFFERENT_INDIVIDUALS
VALUE_PARTITION
public static final java.lang.String VALUE_PARTITION
- See Also:
- Constant Field Values
ONTOLOGY
public static final java.lang.String ONTOLOGY
NAMESPACE
public static final java.lang.String NAMESPACE
IMPORT
public static final java.lang.String IMPORT
SUB_PROPERTY_CHAIN
public static final java.lang.String SUB_PROPERTY_CHAIN
FUNCTIONAL
public static final java.lang.String FUNCTIONAL
INVERSE_FUNCTIONAL
public static final java.lang.String INVERSE_FUNCTIONAL
SYMMETRIC
public static final java.lang.String SYMMETRIC
ANTI_SYMMETRIC
public static final java.lang.String ANTI_SYMMETRIC
ASYMMETRIC
public static final java.lang.String ASYMMETRIC
TRANSITIVE
public static final java.lang.String TRANSITIVE
REFLEXIVE
public static final java.lang.String REFLEXIVE
IRREFLEXIVE
public static final java.lang.String IRREFLEXIVE
INVERSE_OF
public static final java.lang.String INVERSE_OF
ManchesterOWLSyntaxEditorParser
public ManchesterOWLSyntaxEditorParser(OWLDataFactory dataFactory,
java.lang.String s)
getDataFactory
public OWLDataFactory getDataFactory()
getBase
public java.lang.String getBase()
setBase
public void setBase(java.lang.String base)
getOWLEntityChecker
public OWLEntityChecker getOWLEntityChecker()
setOWLEntityChecker
public void setOWLEntityChecker(OWLEntityChecker owlEntityChecker)
isClassName
public boolean isClassName(java.lang.String name)
isObjectPropertyName
public boolean isObjectPropertyName(java.lang.String name)
isAnnotationURI
public boolean isAnnotationURI(java.lang.String name)
isDataPropertyName
public boolean isDataPropertyName(java.lang.String name)
isIndividualName
public boolean isIndividualName(java.lang.String name)
isDatatypeName
public boolean isDatatypeName(java.lang.String name)
getOWLClass
public OWLClass getOWLClass(java.lang.String name)
getOWLObjectProperty
public OWLObjectProperty getOWLObjectProperty(java.lang.String name)
getOWLIndividual
public OWLIndividual getOWLIndividual(java.lang.String name)
getOWLDataProperty
public OWLDataProperty getOWLDataProperty(java.lang.String name)
getDataType
public OWLDataType getDataType(java.lang.String name)
getAnnotationURI
public java.net.URI getAnnotationURI(java.lang.String name)
getToken
public ManchesterOWLSyntaxTokenizer.Token getToken()
getTokenPos
public int getTokenPos()
getTokenCol
public int getTokenCol()
getTokenRow
public int getTokenRow()
parseDescription
public OWLDescription parseDescription()
throws ParserException
- Parses an OWL description that is represented in Manchester OWL Syntax
- Returns:
- The parsed description
- Throws:
ParserException
- If an description could not be parsed.
parseIntersection
public OWLDescription parseIntersection()
throws ParserException
- Throws:
ParserException
parseUnion
public OWLDescription parseUnion()
throws ParserException
- Throws:
ParserException
parseObjectPropertyExpression
public OWLObjectPropertyExpression parseObjectPropertyExpression(boolean allowUndeclared)
throws ParserException
- Throws:
ParserException
parseObjectPropertyExpression
public OWLObjectPropertyExpression parseObjectPropertyExpression()
throws ParserException
- Throws:
ParserException
parseRestriction
public OWLDescription parseRestriction()
throws ParserException
- Throws:
ParserException
parseNonNaryDescription
public OWLDescription parseNonNaryDescription()
throws ParserException
- Parses all class descriptions except ObjectIntersectionOf and ObjectUnionOf
- Returns:
- The description which was parsed
- Throws:
ParserException
- if a non-nary description could not be parsed
parseDataRestriction
public OWLDescription parseDataRestriction()
throws ParserException
- Throws:
ParserException
parseFacet
public OWLRestrictedDataRangeFacetVocabulary parseFacet()
throws ParserException
- Throws:
ParserException
parseDataRange
public OWLDataRange parseDataRange(boolean allowLookahead)
throws ParserException
- Throws:
ParserException
parseConstant
public OWLConstant parseConstant()
throws ParserException
- Throws:
ParserException
parseInteger
public int parseInteger()
throws ParserException
- Throws:
ParserException
getLineCol
public java.lang.String getLineCol()
parseObjectOneOf
public OWLDescription parseObjectOneOf()
throws ParserException
- Throws:
ParserException
parseFrames
public java.util.Set<OWLAxiom> parseFrames()
throws ParserException
- Throws:
ParserException
parseAnnotations
public java.util.Set<OWLAnnotation> parseAnnotations()
throws ParserException
- Throws:
ParserException
parseAnnotations
public java.util.Set<OWLAxiom> parseAnnotations(OWLEntity subject)
throws ParserException
- Throws:
ParserException
parseClassFrame
public java.util.Set<OWLAxiom> parseClassFrame()
throws ParserException
- Throws:
ParserException
parseClassFrameEOF
public java.util.Set<OWLAxiom> parseClassFrameEOF()
throws ParserException
- Throws:
ParserException
parseObjectPropertyFrame
public java.util.Set<OWLAxiom> parseObjectPropertyFrame()
throws ParserException
- Throws:
ParserException
parseObjectPropertyFrame
public java.util.Set<OWLAxiom> parseObjectPropertyFrame(boolean eof)
throws ParserException
- Throws:
ParserException
parseDataPropertyFrame
public java.util.Set<OWLAxiom> parseDataPropertyFrame()
throws ParserException
- Throws:
ParserException
parseIndividualFrame
public java.util.Set<OWLAxiom> parseIndividualFrame()
throws ParserException
- Throws:
ParserException
parseValuePartitionFrame
public java.util.Set<OWLAxiom> parseValuePartitionFrame()
throws ParserException
- Throws:
ParserException
parseValuePartitionValues
public java.util.Set<OWLAxiom> parseValuePartitionValues(OWLClass superclass)
throws ParserException
- Throws:
ParserException
parseDisjointClasses
public OWLDisjointClassesAxiom parseDisjointClasses()
throws ParserException
- Throws:
ParserException
parseSameIndividual
public OWLSameIndividualsAxiom parseSameIndividual()
throws ParserException
- Throws:
ParserException
parseDisjointObjectProperties
public OWLDisjointObjectPropertiesAxiom parseDisjointObjectProperties()
throws ParserException
- Throws:
ParserException
parseDisjointDataProperties
public OWLDisjointDataPropertiesAxiom parseDisjointDataProperties()
throws ParserException
- Throws:
ParserException
parseDifferentIndividuals
public OWLDifferentIndividualsAxiom parseDifferentIndividuals()
throws ParserException
- Throws:
ParserException
parseObjectPropertyCharacteristicList
public java.util.Set<OWLAxiom> parseObjectPropertyCharacteristicList(OWLObjectPropertyExpression prop)
throws ParserException
- Throws:
ParserException
parseDescriptionList
public java.util.Set<OWLDescription> parseDescriptionList()
throws ParserException
- Throws:
ParserException
parseDescriptionList
public java.util.Set<OWLDescription> parseDescriptionList(java.lang.String expectedOpen,
java.lang.String expectedClose)
throws ParserException
- Throws:
ParserException
parseDataPropertyList
public java.util.Set<OWLDataProperty> parseDataPropertyList()
throws ParserException
- Throws:
ParserException
parseObjectPropertyList
public java.util.Set<OWLObjectPropertyExpression> parseObjectPropertyList()
throws ParserException
- Throws:
ParserException
parseIndividualList
public java.util.Set<OWLIndividual> parseIndividualList()
throws ParserException
- Throws:
ParserException
parseObjectPropertyChain
public java.util.List<OWLObjectPropertyExpression> parseObjectPropertyChain()
throws ParserException
- Throws:
ParserException
parsePropertyChainSubPropertyAxiom
public OWLObjectPropertyChainSubPropertyAxiom parsePropertyChainSubPropertyAxiom()
throws ParserException
- Throws:
ParserException
parseClassAxiom
public OWLClassAxiom parseClassAxiom()
throws ParserException
- Throws:
ParserException
parseObjectPropertyAxiom
public OWLObjectPropertyAxiom parseObjectPropertyAxiom()
throws ParserException
- Throws:
ParserException
parseIndividual
public OWLIndividual parseIndividual()
throws ParserException
- Throws:
ParserException
parseIndividual
public OWLIndividual parseIndividual(boolean defined)
throws ParserException
- Throws:
ParserException
parseDataProperty
public OWLDataProperty parseDataProperty()
throws ParserException
- Throws:
ParserException
parseNamespace
public java.util.Map<java.lang.String,java.net.URI> parseNamespace()
throws ParserException
- Throws:
ParserException
parseImportsDeclaration
public OWLImportsDeclaration parseImportsDeclaration(OWLOntology ont)
throws ParserException
- Throws:
ParserException
parseURI
public java.net.URI parseURI()
throws ParserException
- Throws:
ParserException
parseOntology
public void parseOntology(OWLOntologyManager manager,
OWLOntology ont)
throws ParserException,
OWLOntologyCreationException,
OWLOntologyChangeException
- Throws:
ParserException
OWLOntologyCreationException
OWLOntologyChangeException
getURI
public java.net.URI getURI(java.lang.String name)