Package org.obolibrary.robot
Class TemplateHelper
- java.lang.Object
-
- org.obolibrary.robot.TemplateHelper
-
public class TemplateHelper extends Object
Convenience methods for working with templates.- Author:
- Becky Tauber
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
manchesterParseError
Error message when a given class expression is not able to be parsed.
-
Constructor Summary
Constructors Constructor Description TemplateHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static org.semanticweb.owlapi.model.OWLAnnotation
getAnnotation(String tableName, QuotedEntityChecker checker, IOHelper ioHelper, String template, String value)
Deprecated.static org.semanticweb.owlapi.model.OWLAnnotation
getAnnotation(QuotedEntityChecker checker, String template, String value)
Deprecated.static org.semanticweb.owlapi.model.OWLAnnotation
getAnnotation(QuotedEntityChecker checker, IOHelper ioHelper, String template, String value)
Deprecated.static Set<org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom>
getAnnotationAxioms(org.semanticweb.owlapi.model.OWLEntity entity, Set<org.semanticweb.owlapi.model.OWLAnnotation> annotations, Map<org.semanticweb.owlapi.model.OWLAnnotation,Map<org.semanticweb.owlapi.model.OWLAnnotation,Set<org.semanticweb.owlapi.model.OWLAnnotation>>> nested)
Deprecated.TemplateOperation replaced with Template classstatic Set<org.semanticweb.owlapi.model.OWLAnnotationProperty>
getAnnotationProperties(QuotedEntityChecker checker, String value, String split)
Deprecated.static Set<org.semanticweb.owlapi.model.OWLAnnotationProperty>
getAnnotationProperties(QuotedEntityChecker checker, String value, String split, int column)
Given a QuotedEntityChecker, a string value, and a character to split the value string on (or null), return the value or values as a set of OWLAnnotationProperties.static org.semanticweb.owlapi.model.OWLAnnotationProperty
getAnnotationProperty(QuotedEntityChecker checker, String name)
Deprecated.static org.semanticweb.owlapi.model.OWLAnnotationProperty
getAnnotationProperty(QuotedEntityChecker checker, String name, int column)
Find an annotation property with the given name or create one.static Set<org.semanticweb.owlapi.model.OWLAnnotation>
getAnnotations(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column)
Create an OWLAnnotation based on the template string and cell value.static String
getCellContent(List<List<String>> rows, int row, Integer column)
Deprecated.TemplateOperation replaced with Template classstatic Set<org.semanticweb.owlapi.model.OWLClassExpression>
getClassExpressions(String tableName, QuotedEntityChecker checker, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String template, String value, int rowNum, int col)
Given a Quoted Entity checker, a Manchester Syntax parser, a template string, and a template value, insert the value into the template string and parse to a set of class expressions.static Set<org.semanticweb.owlapi.model.OWLClassExpression>
getClassExpressions(String tableName, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String template, String value, int rowNum, int col)
Given a Manchester Syntax parser, a template string, and a template value, insert the value into the template string and parse to a set of class expressions.static Set<org.semanticweb.owlapi.model.OWLDataPropertyExpression>
getDataPropertyExpressions(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column)
Given a QuotedEntityChecker, a template string, and a template value, return a set of data property expressions based on the value or values (if SPLIT is included in the template string).static org.semanticweb.owlapi.model.OWLDatatype
getDatatype(String tableName, QuotedEntityChecker checker, String name, int rowNum, int column)
Find a datatype with the given name or create one.static org.semanticweb.owlapi.model.OWLDatatype
getDatatype(QuotedEntityChecker checker, String name)
Find a datatype with the given name or create one.static Set<org.semanticweb.owlapi.model.OWLDatatype>
getDatatypes(String tableName, QuotedEntityChecker checker, String value, String split, int rowNum, int column)
Given a QuotedEntityChecker, a string value, and a character to split the value string on (or null), return the value or values as a set of OWLDatatypes.static org.semanticweb.owlapi.model.OWLEntity
getEntity(QuotedEntityChecker checker, org.semanticweb.owlapi.model.IRI type, String id, String label)
Deprecated.TemplateOperation replaced with Template classstatic Set<org.semanticweb.owlapi.model.OWLIndividual>
getIndividuals(QuotedEntityChecker checker, String value, String split)
Given a QuotedEntityChecker, a string value (maybe separated by a split character), and a split character (or null), return the value or values as a set of OWLIndividuals.static org.semanticweb.owlapi.model.OWLAnnotation
getIRIAnnotation(QuotedEntityChecker checker, String template, String value)
Deprecated.static org.semanticweb.owlapi.model.OWLAnnotation
getIRIAnnotation(QuotedEntityChecker checker, String template, String value, int column)
Return an IRI annotation for the given template string and string value.static org.semanticweb.owlapi.model.OWLAnnotation
getIRIAnnotation(QuotedEntityChecker checker, String template, org.semanticweb.owlapi.model.IRI value)
Deprecated.static org.semanticweb.owlapi.model.OWLAnnotation
getIRIAnnotation(QuotedEntityChecker checker, String template, org.semanticweb.owlapi.model.IRI value, int column)
Return an IRI annotation for the given template string and IRI value.static List<org.semanticweb.owlapi.model.IRI>
getIRIs(String tableName, List<List<String>> rows, IOHelper ioHelper)
Get a list of the IRIs defined in a template table.static List<org.semanticweb.owlapi.model.IRI>
getIRIs(Map<String,List<List<String>>> tables, IOHelper ioHelper)
Get a list of the IRIs defined in a set of template tables.static org.semanticweb.owlapi.model.OWLAnnotation
getLanguageAnnotation(QuotedEntityChecker checker, String template, String value)
Deprecated.static Set<org.semanticweb.owlapi.model.OWLAnnotation>
getLanguageAnnotations(QuotedEntityChecker checker, String template, String split, String value)
Deprecated.static Set<org.semanticweb.owlapi.model.OWLAnnotation>
getLanguageAnnotations(QuotedEntityChecker checker, String template, String split, String value, int column)
Return a set of language tagged annotations for the given template and value(s).static Set<org.semanticweb.owlapi.model.OWLLiteral>
getLiterals(String tableName, QuotedEntityChecker checker, String value, String split, int rowNum, int column)
Given a QuotedEntityChecker, a string value (maybe separated by a split character), and a split character (or null), return the value or values as a set of OWLLiterals.static Set<org.semanticweb.owlapi.model.OWLAxiom>
getLogicalAxioms(org.semanticweb.owlapi.model.OWLClass cls, String classType, Set<org.semanticweb.owlapi.model.OWLClassExpression> classExpressions, Map<org.semanticweb.owlapi.model.OWLClassExpression,Set<org.semanticweb.owlapi.model.OWLAnnotation>> annotatedExpressions)
Deprecated.TemplateOperation replaced with Template classstatic Set<org.semanticweb.owlapi.model.OWLObjectPropertyExpression>
getObjectPropertyExpressions(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column)
Given a QuotedEntityChecker, a template string, and a template value, return a set of object property expressions based on the value or values (if SPLIT is included in the template string).static org.semanticweb.owlapi.model.OWLAnnotation
getStringAnnotation(QuotedEntityChecker checker, String template, String value)
Deprecated.static Set<org.semanticweb.owlapi.model.OWLAnnotation>
getStringAnnotations(QuotedEntityChecker checker, String template, String split, String value)
Deprecated.static Set<org.semanticweb.owlapi.model.OWLAnnotation>
getStringAnnotations(QuotedEntityChecker checker, String template, String split, String value, int column)
Return a set of string annotations for the given template string and value(s).static org.semanticweb.owlapi.model.OWLAnnotation
getTypedAnnotation(QuotedEntityChecker checker, String template, String value)
Deprecated.static Set<org.semanticweb.owlapi.model.OWLAnnotation>
getTypedAnnotations(String tableName, QuotedEntityChecker checker, String template, String split, String value, int rowNum, int column)
Return a set of typed annotations for the given template string and value(s).static Set<org.semanticweb.owlapi.model.IRI>
getValueIRIs(QuotedEntityChecker checker, String value, String split)
Given a QuotedEntityChecker, a value, and a split character (or null), return the value (or values) as a set of IRIs.static String
processSplit(String template, String cell, List<String> values)
Deprecated.TemplateOperation replaced with Template classstatic List<List<String>>
readCSV(InputStream stream)
Read comma-separated values from a stream to a list of lists of strings.static List<List<String>>
readCSV(Reader reader)
Read comma-separated values from a reader to a list of lists of strings.static List<List<String>>
readCSV(String path)
Read comma-separated values from a path to a list of lists of strings.static List<List<String>>
readTable(String path)
Read a table from a path to a list of lists of strings.static List<List<String>>
readTSV(InputStream stream)
Read tab-separated values from a stream to a list of lists of strings.static List<List<String>>
readTSV(Reader reader)
Read tab-separated values from a reader to a list of lists of strings.static List<List<String>>
readTSV(String path)
Read tab-separated values from a path to a list of lists of strings.protected static org.semanticweb.owlapi.model.OWLClassExpression
tryParse(String tableName, QuotedEntityChecker checker, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String content, int rowNum, int column)
Given a Quoted Entity Checker to resolve labels, a Manchester class expression parser, and a content string, try to parse the content string.protected static org.semanticweb.owlapi.model.OWLClassExpression
tryParse(String tableName, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String content, int rowNum, int column)
Given a Manchester class expression parser and a content string, try to parse the content string.static boolean
validateTemplateString(String template)
Return true if the template string is valid, false otherwise.
-
-
-
Field Detail
-
manchesterParseError
protected static final String manchesterParseError
Error message when a given class expression is not able to be parsed.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAnnotationProperties
public static Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> getAnnotationProperties(QuotedEntityChecker checker, String value, String split, int column) throws Exception
Given a QuotedEntityChecker, a string value, and a character to split the value string on (or null), return the value or values as a set of OWLAnnotationProperties.- Parameters:
checker
- QuotedEntityChecker to get propertiesvalue
- value or values to parse to propertiessplit
- character to split value on or nullcolumn
- the column number for logging- Returns:
- set of OWLAnnotationProperties
- Throws:
RowParseException
- if property cannot be found or createdException
-
getAnnotationProperty
public static org.semanticweb.owlapi.model.OWLAnnotationProperty getAnnotationProperty(QuotedEntityChecker checker, String name, int column) throws Exception
Find an annotation property with the given name or create one.- Parameters:
checker
- used to search by rdfs:label (for example)name
- the name to search forcolumn
- the column number for logging- Returns:
- an annotation property
- Throws:
RowParseException
- if the name cannot be resolvedException
-
getAnnotations
public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getAnnotations(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column) throws Exception
Create an OWLAnnotation based on the template string and cell value. Replaced by getAnnotation(QuotedEntityChecker checker, String template, String value).- Parameters:
tableName
- name of tablechecker
- used to resolve the annotation property and IRIstemplate
- the template stringvalue
- the value for the annotationrowNum
- the row number for loggingcolumn
- the column number for logging- Returns:
- OWLAnnotation, or null if template string is not supported
- Throws:
RowParseException
- if a row value cannot be parsedColumnException
- if a header annotation template cannot be parsedException
-
getClassExpressions
public static Set<org.semanticweb.owlapi.model.OWLClassExpression> getClassExpressions(String tableName, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String template, String value, int rowNum, int col) throws RowParseException
Given a Manchester Syntax parser, a template string, and a template value, insert the value into the template string and parse to a set of class expressions. If the template string contains 'SPLIT=', the value will be split on the provided character. Otherwise, the set will only have one entry.- Parameters:
tableName
- name of tableparser
- ManchesterOWLSyntaxClassExpressionParser to parse expressiontemplate
- template stringvalue
- value to replace '%' in template stringrowNum
- the line numbercol
- the column number- Returns:
- set of OWLClassExpressions
- Throws:
RowParseException
- if row is malformed
-
getClassExpressions
public static Set<org.semanticweb.owlapi.model.OWLClassExpression> getClassExpressions(String tableName, QuotedEntityChecker checker, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String template, String value, int rowNum, int col) throws RowParseException
Given a Quoted Entity checker, a Manchester Syntax parser, a template string, and a template value, insert the value into the template string and parse to a set of class expressions. If the template string contains 'SPLIT=', the value will be split on the provided character. Otherwise, the set will only have one entry.- Parameters:
tableName
- name of tablechecker
- QuotedEntityChecker to resolve labelsparser
- ManchesterOWLSyntaxClassExpressionParser to parse expressiontemplate
- template stringvalue
- value to replace '%' in template stringrowNum
- the line numbercol
- the column number- Returns:
- set of OWLClassExpressions
- Throws:
RowParseException
- if row is malformed
-
getDataPropertyExpressions
public static Set<org.semanticweb.owlapi.model.OWLDataPropertyExpression> getDataPropertyExpressions(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column) throws RowParseException
Given a QuotedEntityChecker, a template string, and a template value, return a set of data property expressions based on the value or values (if SPLIT is included in the template string). Note that a data property expression can ONLY be another data property, but this allows support for future data property expressions.- Parameters:
tableName
- name of tablechecker
- QuotedEntityChecker to resolve entitiestemplate
- template stringvalue
- template value or valuesrowNum
- the row number for loggingcolumn
- the column number for logging- Returns:
- set of OWLDataPropertyExpressions
- Throws:
RowParseException
- if row is malformed
-
getDatatype
public static org.semanticweb.owlapi.model.OWLDatatype getDatatype(String tableName, QuotedEntityChecker checker, String name, int rowNum, int column) throws RowParseException
Find a datatype with the given name or create one.- Parameters:
tableName
- name of tablechecker
- used to search by rdfs:label (for example)name
- the name to search forrowNum
- the row numbercolumn
- the column number- Returns:
- a datatype
- Throws:
RowParseException
- if the name cannot be resolved
-
getDatatype
public static org.semanticweb.owlapi.model.OWLDatatype getDatatype(QuotedEntityChecker checker, String name)
Find a datatype with the given name or create one.- Parameters:
checker
- used to search by rdfs:label (for example)name
- the name to search for- Returns:
- a datatype or null
-
getDatatypes
public static Set<org.semanticweb.owlapi.model.OWLDatatype> getDatatypes(String tableName, QuotedEntityChecker checker, String value, String split, int rowNum, int column) throws RowParseException
Given a QuotedEntityChecker, a string value, and a character to split the value string on (or null), return the value or values as a set of OWLDatatypes.- Parameters:
tableName
- name of tablechecker
- QuotedEntityChecker to get OWLDatatypesvalue
- value or values to parse to datatypessplit
- character to split value on or nullrowNum
- the row numbercolumn
- the column number- Returns:
- set of OWLDatatypes
- Throws:
RowParseException
- if datatype cannot be found or created
-
getIndividuals
public static Set<org.semanticweb.owlapi.model.OWLIndividual> getIndividuals(QuotedEntityChecker checker, String value, String split)
Given a QuotedEntityChecker, a string value (maybe separated by a split character), and a split character (or null), return the value or values as a set of OWLIndividuals.- Parameters:
checker
- QuotedEntityChecker to get individuals by labelvalue
- string of individual or individuals by label or IDsplit
- character to split value string on- Returns:
- set of OWLIndividuals
-
getIRIAnnotation
public static org.semanticweb.owlapi.model.OWLAnnotation getIRIAnnotation(QuotedEntityChecker checker, String template, String value, int column) throws Exception
Return an IRI annotation for the given template string and string value. The template string format is "AI [name]" and the value is the name of an entity or an IRI.- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotationcolumn
- the column number for logging- Returns:
- a new annotation axiom with property and an IRI value
- Throws:
RowParseException
- if the annotation property cannot be found or the IRI cannot be createdException
-
getIRIAnnotation
public static org.semanticweb.owlapi.model.OWLAnnotation getIRIAnnotation(QuotedEntityChecker checker, String template, org.semanticweb.owlapi.model.IRI value, int column) throws Exception
Return an IRI annotation for the given template string and IRI value. The template string format is "AI [name]" and the value is an IRI.- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the IRI value for the annotationcolumn
- the column number for logging- Returns:
- a new annotation axiom with property and an IRI value
- Throws:
RowParseException
- if the annotation property cannot be foundException
-
getIRIs
public static List<org.semanticweb.owlapi.model.IRI> getIRIs(Map<String,List<List<String>>> tables, IOHelper ioHelper) throws Exception
Get a list of the IRIs defined in a set of template tables.- Parameters:
tables
- a map from table names to tablesioHelper
- used to find entities by name- Returns:
- a list of IRIs
- Throws:
ColumnException
- when an ID column does not existException
-
getIRIs
public static List<org.semanticweb.owlapi.model.IRI> getIRIs(String tableName, List<List<String>> rows, IOHelper ioHelper) throws Exception
Get a list of the IRIs defined in a template table.- Parameters:
tableName
- the name of the tablerows
- the table of dataioHelper
- used to find entities by name- Returns:
- a list of IRIs
- Throws:
ColumnException
- when an ID column does not existException
-
getLanguageAnnotations
public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getLanguageAnnotations(QuotedEntityChecker checker, String template, String split, String value, int column) throws Exception
Return a set of language tagged annotations for the given template and value(s). The template string format is "AL [name]@[lang]" and the value is any string.- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringsplit
- the character to split values onvalue
- the value for the annotationcolumn
- the column index for the value from the template- Returns:
- a set of new annotation(s) with property and language tagged literal
- Throws:
RowParseException
- if the annotation property cannot be foundException
-
getLiterals
public static Set<org.semanticweb.owlapi.model.OWLLiteral> getLiterals(String tableName, QuotedEntityChecker checker, String value, String split, int rowNum, int column) throws RowParseException
Given a QuotedEntityChecker, a string value (maybe separated by a split character), and a split character (or null), return the value or values as a set of OWLLiterals.- Parameters:
tableName
- name of tablechecker
- QuotedEntityChecker to get datatypesvalue
- string of literal or literalssplit
- character to split value string onrowNum
- the row numbercolumn
- the column number- Returns:
- set of OWLLiterals
- Throws:
RowParseException
- if row is malformed
-
getObjectPropertyExpressions
public static Set<org.semanticweb.owlapi.model.OWLObjectPropertyExpression> getObjectPropertyExpressions(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column) throws RowParseException
Given a QuotedEntityChecker, a template string, and a template value, return a set of object property expressions based on the value or values (if SPLIT is included in the template string). Note that an object property expression can ONLY be another object property or 'inverse', but this allows support for future data property expressions.- Parameters:
tableName
- name of tablechecker
- QuotedEntityChecker to resolve entitiestemplate
- template stringvalue
- template value or valuesrowNum
- the row number for loggingcolumn
- the column number for logging- Returns:
- set of OWLDataPropertyExpressions
- Throws:
RowParseException
- if row is malformed
-
getStringAnnotations
public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getStringAnnotations(QuotedEntityChecker checker, String template, String split, String value, int column) throws Exception
Return a set of string annotations for the given template string and value(s).- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringsplit
- the character to split values onvalue
- the value for the annotationcolumn
- the index of the column- Returns:
- a set of new annotation(s) with property and string literal value
- Throws:
RowParseException
- if the annotation property cannot be foundException
-
getTypedAnnotations
public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getTypedAnnotations(String tableName, QuotedEntityChecker checker, String template, String split, String value, int rowNum, int column) throws Exception
Return a set of typed annotations for the given template string and value(s). The template string format is "AT [name]^^[datatype]" and the value is any string.- Parameters:
tableName
- name of tablechecker
- used to resolve the annotation property and datatypetemplate
- the template stringsplit
- the character to split values onvalue
- the value for the annotationrowNum
- the row numbercolumn
- the column number- Returns:
- a set of new annotation(s) with property and typed literal value
- Throws:
RowParseException
- if the annotation property cannot be foundException
-
getValueIRIs
public static Set<org.semanticweb.owlapi.model.IRI> getValueIRIs(QuotedEntityChecker checker, String value, String split)
Given a QuotedEntityChecker, a value, and a split character (or null), return the value (or values) as a set of IRIs.- Parameters:
checker
- QuotedEntityChecker to get IRIsvalue
- value (or values) to parse to IRIsplit
- character to split value on- Returns:
- set of IRIs
-
readCSV
public static List<List<String>> readCSV(String path) throws IOException
Read comma-separated values from a path to a list of lists of strings.- Parameters:
path
- file path to the CSV file- Returns:
- a list of lists of strings
- Throws:
IOException
- on file or reading problems
-
readCSV
public static List<List<String>> readCSV(InputStream stream) throws IOException
Read comma-separated values from a stream to a list of lists of strings.- Parameters:
stream
- the stream to read from- Returns:
- a list of lists of strings
- Throws:
IOException
- on file or reading problems
-
readCSV
public static List<List<String>> readCSV(Reader reader) throws IOException
Read comma-separated values from a reader to a list of lists of strings.- Parameters:
reader
- a reader to read data from- Returns:
- a list of lists of strings
- Throws:
IOException
- on file or reading problems
-
readTable
public static List<List<String>> readTable(String path) throws IOException
Read a table from a path to a list of lists of strings.- Parameters:
path
- file path to the CSV file- Returns:
- a list of lists of strings
- Throws:
IOException
- on file or reading problems
-
readTSV
public static List<List<String>> readTSV(String path) throws IOException
Read tab-separated values from a path to a list of lists of strings.- Parameters:
path
- file path to the CSV file- Returns:
- a list of lists of strings
- Throws:
IOException
- on file or reading problems
-
readTSV
public static List<List<String>> readTSV(InputStream stream) throws IOException
Read tab-separated values from a stream to a list of lists of strings.- Parameters:
stream
- the stream to read from- Returns:
- a list of lists of strings
- Throws:
IOException
- on file or reading problems
-
readTSV
public static List<List<String>> readTSV(Reader reader) throws IOException
Read tab-separated values from a reader to a list of lists of strings.- Parameters:
reader
- a reader to read data from- Returns:
- a list of lists of strings
- Throws:
IOException
- on file or reading problems
-
validateTemplateString
public static boolean validateTemplateString(String template)
Return true if the template string is valid, false otherwise.- Parameters:
template
- the template string to check- Returns:
- true if valid, false otherwise
-
tryParse
protected static org.semanticweb.owlapi.model.OWLClassExpression tryParse(String tableName, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String content, int rowNum, int column) throws RowParseException
Given a Manchester class expression parser and a content string, try to parse the content string. Throw a detailed exception message if parsing fails.- Parameters:
tableName
- name of tableparser
- ManchesterOWLSyntaxClassExpressionParser to parse stringcontent
- class expression string to parserowNum
- the row number for loggingcolumn
- the column number for logging- Returns:
- OWLClassExpression representation of the string
- Throws:
RowParseException
- if string cannot be parsed for any reason
-
tryParse
protected static org.semanticweb.owlapi.model.OWLClassExpression tryParse(String tableName, QuotedEntityChecker checker, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String content, int rowNum, int column) throws RowParseException
Given a Quoted Entity Checker to resolve labels, a Manchester class expression parser, and a content string, try to parse the content string. If the checker is not null, first try to get a named class. If not found, try to parse using the parser. Throw a detailed exception message if parsing fails.- Parameters:
tableName
- name of tablechecker
- QuotedEntityChecker to resolve labelsparser
- ManchesterOWLSyntaxClassExpressionParser to parse stringcontent
- class expression string to parserowNum
- the row number for loggingcolumn
- the column number for logging- Returns:
- OWLClassExpression representation of the string
- Throws:
RowParseException
- if string cannot be parsed for any reason
-
getAnnotation
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getAnnotation(String tableName, QuotedEntityChecker checker, IOHelper ioHelper, String template, String value) throws Exception
Deprecated.Create an OWLAnnotation based on the template string and cell value. Replaced by more-specific methods to get annotations by their type (e.g., getStringAnnotation).- Parameters:
tableName
- name of tablechecker
- used to resolve the annotation propertyioHelper
- IOHelper used to create IRIs from valuestemplate
- the template stringvalue
- the value for the annotation- Returns:
- OWLAnnotation, or null if template string is not supported
- Throws:
Exception
- if annotation property cannot be found
-
getAnnotation
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
Deprecated.Create an OWLAnnotation based on the template string and cell value. Replaced by more-specific methods to get annotations by their type (e.g., getStringAnnotation).- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotation- Returns:
- OWLAnnotation, or null if template string is not supported
- Throws:
Exception
- if annotation cannot be created
-
getAnnotation
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getAnnotation(QuotedEntityChecker checker, IOHelper ioHelper, String template, String value) throws Exception
Deprecated.Create an OWLAnnotation based on the template string and cell value. Replaced by more-specific methods to get annotations by their type (e.g., getStringAnnotation).- Parameters:
checker
- used to resolve the annotation propertyioHelper
- IOHelper used to create IRIs from valuestemplate
- the template stringvalue
- the value for the annotation- Returns:
- OWLAnnotation, or null if template string is not supported
- Throws:
Exception
- if annotation property cannot be found
-
getAnnotationAxioms
@Deprecated public static Set<org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom> getAnnotationAxioms(org.semanticweb.owlapi.model.OWLEntity entity, Set<org.semanticweb.owlapi.model.OWLAnnotation> annotations, Map<org.semanticweb.owlapi.model.OWLAnnotation,Map<org.semanticweb.owlapi.model.OWLAnnotation,Set<org.semanticweb.owlapi.model.OWLAnnotation>>> nested)
Deprecated.TemplateOperation replaced with Template classGet a set of annotation axioms for an OWLEntity. Supports axiom annotations and axiom annotation annotations.- Parameters:
entity
- OWLEntity to annotationannotations
- Set of OWLAnnotationsnested
- Map with top-level OWLAnnotation as key and another map (axiom OWLAnnotation, set of axiom annotation OWLAnnotations) as value- Returns:
- Set of OWLAnnotationAssertionAxioms
-
getAnnotationProperties
@Deprecated public static Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> getAnnotationProperties(QuotedEntityChecker checker, String value, String split) throws Exception
Deprecated.Given a QuotedEntityChecker, a string value, and a character to split the value string on (or null), return the value or values as a set of OWLAnnotationProperties.- Parameters:
checker
- QuotedEntityChecker to get propertiesvalue
- value or values to parse to propertiessplit
- character to split value on or null- Returns:
- set of OWLAnnotationProperties
- Throws:
RowParseException
- if property cannot be found or createdException
-
getAnnotationProperty
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotationProperty getAnnotationProperty(QuotedEntityChecker checker, String name) throws Exception
Deprecated.Find an annotation property with the given name or create one.- Parameters:
checker
- used to search by rdfs:label (for example)name
- the name to search for- Returns:
- an annotation property
- Throws:
RowParseException
- if the name cannot be resolvedException
-
getCellContent
@Deprecated public static String getCellContent(List<List<String>> rows, int row, Integer column)
Deprecated.TemplateOperation replaced with Template classGiven a set of rows, the row number, and the column number, get the content in the column for the row. If there are any issues, return an empty string. If the cell is empty, return null.- Parameters:
rows
- list of rows (lists of strings)row
- row number to get ID ofcolumn
- column number- Returns:
- content, null, or empty string.
-
getEntity
@Deprecated public static org.semanticweb.owlapi.model.OWLEntity getEntity(QuotedEntityChecker checker, org.semanticweb.owlapi.model.IRI type, String id, String label)
Deprecated.TemplateOperation replaced with Template classUse type, id, and label information to get an entity from the data in a row. Requires either: an id (default type is owl:Class); an id and type; or a label.- Parameters:
checker
- for looking up labelstype
- the IRI of the type for this entity, or nullid
- the ID for this entity, or nulllabel
- the label for this entity, or null- Returns:
- the entity or null
-
getIRIAnnotation
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getIRIAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
Deprecated.Return an IRI annotation for the given template string and string value. The template string format is "AI [name]" and the value is the name of an entity or an IRI.- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotation- Returns:
- a new annotation axiom with property and an IRI value
- Throws:
RowParseException
- if the annotation property cannot be found or the IRI cannot be createdException
-
getIRIAnnotation
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getIRIAnnotation(QuotedEntityChecker checker, String template, org.semanticweb.owlapi.model.IRI value) throws Exception
Deprecated.Return an IRI annotation for the given template string and IRI value. The template string format is "AI [name]" and the value is an IRI.- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the IRI value for the annotation- Returns:
- a new annotation axiom with property and an IRI value
- Throws:
RowParseException
- if the annotation property cannot be foundException
-
getLanguageAnnotation
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getLanguageAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
Deprecated.Return a set of language tagged annotations for the given template and value. The template string format is "AL [name]@[lang]" and the value is any string. Replaced by sets of annotations to support splits.- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotation- Returns:
- a new annotation with property and language tagged literal
- Throws:
Exception
- if the annotation property cannot be found
-
getLanguageAnnotations
@Deprecated public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getLanguageAnnotations(QuotedEntityChecker checker, String template, String split, String value) throws Exception
Deprecated.Return a set of language tagged annotations for the given template and value(s). The template string format is "AL [name]@[lang]" and the value is any string.- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringsplit
- the character to split values onvalue
- the value for the annotation- Returns:
- a set of new annotation(s) with property and language tagged literal
- Throws:
RowParseException
- if the annotation property cannot be foundException
-
getLogicalAxioms
@Deprecated public static Set<org.semanticweb.owlapi.model.OWLAxiom> getLogicalAxioms(org.semanticweb.owlapi.model.OWLClass cls, String classType, Set<org.semanticweb.owlapi.model.OWLClassExpression> classExpressions, Map<org.semanticweb.owlapi.model.OWLClassExpression,Set<org.semanticweb.owlapi.model.OWLAnnotation>> annotatedExpressions) throws Exception
Deprecated.TemplateOperation replaced with Template classGet a set of OWLAxioms (subclass or equivalent) for an OWLClass. Supports axiom annotations.- Parameters:
cls
- OWLClass to add axioms toclassType
- subclass or equivalentclassExpressions
- Set of OWLClassExpressionsannotatedExpressions
- Map of annotated OWLClassExpressions and the Set of OWLAnnotations- Returns:
- Set of OWLAxioms, or null if classType is not subclass or equivalent
- Throws:
Exception
- if classType is not subclass or equivalent
-
getStringAnnotation
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getStringAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
Deprecated.Return a string annotation for the given template string and value. Replaced by sets of annotations to support splits.- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotation- Returns:
- a new annotation with property and string literal value
- Throws:
Exception
- if the annotation property cannot be found
-
getStringAnnotations
@Deprecated public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getStringAnnotations(QuotedEntityChecker checker, String template, String split, String value) throws Exception
Deprecated.Return a set of string annotations for the given template string and value(s).- Parameters:
checker
- used to resolve the annotation propertytemplate
- the template stringsplit
- the character to split values onvalue
- the value for the annotation- Returns:
- a set of new annotation(s) with property and string literal value
- Throws:
RowParseException
- if the annotation property cannot be foundException
-
getTypedAnnotation
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getTypedAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
Deprecated.Return a set of typed annotations for the given template string and value. The template string format is "AT [name]^^[datatype]" and the value is any string. Replaced by sets of annotations to support splits.- Parameters:
checker
- used to resolve the annotation property and datatypetemplate
- the template stringvalue
- the value for the annotation- Returns:
- a new annotation with property and typed literal value
- Throws:
Exception
- if the annotation property cannot be found
-
processSplit
@Deprecated public static String processSplit(String template, String cell, List<String> values)
Deprecated.TemplateOperation replaced with Template classGiven a template string, a cell value, and an empty list, fill the list with any number of values based on a SPLIT character, then return the template string without SPLIT. If there are no SPLITs, only add the original cell to the values.- Parameters:
template
- template stringcell
- cell contentsvalues
- empty list to fill- Returns:
- template string without SPLIT
-
-