public class TemplateHelper extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
manchesterParseError
Error message when a given class expression is not able to be parsed.
|
Constructor and Description |
---|
TemplateHelper() |
Modifier and Type | Method and Description |
---|---|
static org.semanticweb.owlapi.model.OWLAnnotation |
getAnnotation(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(String tableName,
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 class
|
static 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 class
|
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(QuotedEntityChecker checker,
String name)
Find a datatype with the given name or create one.
|
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 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 class
|
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.
|
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 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 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 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 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 class
|
static 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 class
|
static 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,
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.
|
protected static final String manchesterParseError
public static Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> getAnnotationProperties(QuotedEntityChecker checker, String value, String split, int column) throws Exception
checker
- QuotedEntityChecker to get propertiesvalue
- value or values to parse to propertiessplit
- character to split value on or nullcolumn
- the column number for loggingRowParseException
- if property cannot be found or createdException
public static org.semanticweb.owlapi.model.OWLAnnotationProperty getAnnotationProperty(QuotedEntityChecker checker, String name, int column) throws Exception
checker
- used to search by rdfs:label (for example)name
- the name to search forcolumn
- the column number for loggingRowParseException
- if the name cannot be resolvedException
public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getAnnotations(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column) throws Exception
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 loggingRowParseException
- if a row value cannot be parsedColumnException
- if a header annotation template cannot be parsedException
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
tableName
- name of tableparser
- ManchesterOWLSyntaxClassExpressionParser to parse expressiontemplate
- template stringvalue
- value to replace '%' in template stringrowNum
- the line numbercol
- the column numberRowParseException
- if row is malformedpublic static Set<org.semanticweb.owlapi.model.OWLDataPropertyExpression> getDataPropertyExpressions(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column) throws RowParseException
tableName
- name of tablechecker
- QuotedEntityChecker to resolve entitiestemplate
- template stringvalue
- template value or valuesrowNum
- the row number for loggingcolumn
- the column number for loggingRowParseException
- if row is malformedpublic static org.semanticweb.owlapi.model.OWLDatatype getDatatype(String tableName, QuotedEntityChecker checker, String name, int rowNum, int column) throws RowParseException
tableName
- name of tablechecker
- used to search by rdfs:label (for example)name
- the name to search forrowNum
- the row numbercolumn
- the column numberRowParseException
- if the name cannot be resolvedpublic static org.semanticweb.owlapi.model.OWLDatatype getDatatype(QuotedEntityChecker checker, String name)
checker
- used to search by rdfs:label (for example)name
- the name to search forpublic static Set<org.semanticweb.owlapi.model.OWLDatatype> getDatatypes(String tableName, QuotedEntityChecker checker, String value, String split, int rowNum, int column) throws RowParseException
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 numberRowParseException
- if datatype cannot be found or createdpublic static Set<org.semanticweb.owlapi.model.OWLIndividual> getIndividuals(QuotedEntityChecker checker, String value, String split)
checker
- QuotedEntityChecker to get individuals by labelvalue
- string of individual or individuals by label or IDsplit
- character to split value string onpublic static org.semanticweb.owlapi.model.OWLAnnotation getIRIAnnotation(QuotedEntityChecker checker, String template, String value, int column) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotationcolumn
- the column number for loggingRowParseException
- if the annotation property cannot be found or the IRI cannot be
createdException
public static org.semanticweb.owlapi.model.OWLAnnotation getIRIAnnotation(QuotedEntityChecker checker, String template, org.semanticweb.owlapi.model.IRI value, int column) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the IRI value for the annotationcolumn
- the column number for loggingRowParseException
- if the annotation property cannot be foundException
public static List<org.semanticweb.owlapi.model.IRI> getIRIs(Map<String,List<List<String>>> tables, IOHelper ioHelper) throws Exception
tables
- a map from table names to tablesioHelper
- used to find entities by nameColumnException
- when an ID column does not existException
public static List<org.semanticweb.owlapi.model.IRI> getIRIs(String tableName, List<List<String>> rows, IOHelper ioHelper) throws Exception
tableName
- the name of the tablerows
- the table of dataioHelper
- used to find entities by nameColumnException
- when an ID column does not existException
public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getLanguageAnnotations(QuotedEntityChecker checker, String template, String split, String value, int column) throws Exception
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 templateRowParseException
- if the annotation property cannot be foundException
public static Set<org.semanticweb.owlapi.model.OWLLiteral> getLiterals(String tableName, QuotedEntityChecker checker, String value, String split, int rowNum, int column) throws RowParseException
tableName
- name of tablechecker
- QuotedEntityChecker to get datatypesvalue
- string of literal or literalssplit
- character to split value string onrowNum
- the row numbercolumn
- the column numberRowParseException
- if row is malformedpublic static Set<org.semanticweb.owlapi.model.OWLObjectPropertyExpression> getObjectPropertyExpressions(String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column) throws RowParseException
tableName
- name of tablechecker
- QuotedEntityChecker to resolve entitiestemplate
- template stringvalue
- template value or valuesrowNum
- the row number for loggingcolumn
- the column number for loggingRowParseException
- if row is malformedpublic static Set<org.semanticweb.owlapi.model.OWLAnnotation> getStringAnnotations(QuotedEntityChecker checker, String template, String split, String value, int column) throws Exception
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 columnRowParseException
- if the annotation property cannot be foundException
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
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 numberRowParseException
- if the annotation property cannot be foundException
public static Set<org.semanticweb.owlapi.model.IRI> getValueIRIs(QuotedEntityChecker checker, String value, String split)
checker
- QuotedEntityChecker to get IRIsvalue
- value (or values) to parse to IRIsplit
- character to split value onpublic static List<List<String>> readCSV(String path) throws IOException
path
- file path to the CSV fileIOException
- on file or reading problemspublic static List<List<String>> readCSV(InputStream stream) throws IOException
stream
- the stream to read fromIOException
- on file or reading problemspublic static List<List<String>> readCSV(Reader reader) throws IOException
reader
- a reader to read data fromIOException
- on file or reading problemspublic static List<List<String>> readTable(String path) throws IOException
path
- file path to the CSV fileIOException
- on file or reading problemspublic static List<List<String>> readTSV(String path) throws IOException
path
- file path to the CSV fileIOException
- on file or reading problemspublic static List<List<String>> readTSV(InputStream stream) throws IOException
stream
- the stream to read fromIOException
- on file or reading problemspublic static List<List<String>> readTSV(Reader reader) throws IOException
reader
- a reader to read data fromIOException
- on file or reading problemspublic static boolean validateTemplateString(String template)
template
- the template string to checkprotected static org.semanticweb.owlapi.model.OWLClassExpression tryParse(String tableName, org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser parser, String content, int rowNum, int column) throws RowParseException
tableName
- name of tableparser
- ManchesterOWLSyntaxClassExpressionParser to parse stringcontent
- class expression string to parserowNum
- the row number for loggingcolumn
- the column number for loggingRowParseException
- if string cannot be parsed for any reason@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getAnnotation(String tableName, QuotedEntityChecker checker, IOHelper ioHelper, String template, String value) throws Exception
tableName
- name of tablechecker
- used to resolve the annotation propertyioHelper
- IOHelper used to create IRIs from valuestemplate
- the template stringvalue
- the value for the annotationException
- if annotation property cannot be found@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotationException
- if annotation cannot be created@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getAnnotation(QuotedEntityChecker checker, IOHelper ioHelper, String template, String value) throws Exception
checker
- used to resolve the annotation propertyioHelper
- IOHelper used to create IRIs from valuestemplate
- the template stringvalue
- the value for the annotationException
- if annotation property cannot be found@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)
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@Deprecated public static Set<org.semanticweb.owlapi.model.OWLAnnotationProperty> getAnnotationProperties(QuotedEntityChecker checker, String value, String split) throws Exception
checker
- QuotedEntityChecker to get propertiesvalue
- value or values to parse to propertiessplit
- character to split value on or nullRowParseException
- if property cannot be found or createdException
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotationProperty getAnnotationProperty(QuotedEntityChecker checker, String name) throws Exception
checker
- used to search by rdfs:label (for example)name
- the name to search forRowParseException
- if the name cannot be resolvedException
@Deprecated public static String getCellContent(List<List<String>> rows, int row, Integer column)
rows
- list of rows (lists of strings)row
- row number to get ID ofcolumn
- column number@Deprecated public static org.semanticweb.owlapi.model.OWLEntity getEntity(QuotedEntityChecker checker, org.semanticweb.owlapi.model.IRI type, String id, String label)
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@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getIRIAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotationRowParseException
- if the annotation property cannot be found or the IRI cannot be
createdException
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getIRIAnnotation(QuotedEntityChecker checker, String template, org.semanticweb.owlapi.model.IRI value) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the IRI value for the annotationRowParseException
- if the annotation property cannot be foundException
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getLanguageAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotationException
- if the annotation property cannot be found@Deprecated public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getLanguageAnnotations(QuotedEntityChecker checker, String template, String split, String value) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringsplit
- the character to split values onvalue
- the value for the annotationRowParseException
- if the annotation property cannot be foundException
@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
cls
- OWLClass to add axioms toclassType
- subclass or equivalentclassExpressions
- Set of OWLClassExpressionsannotatedExpressions
- Map of annotated OWLClassExpressions and the Set of OWLAnnotationsException
- if classType is not subclass or equivalent@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getStringAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringvalue
- the value for the annotationException
- if the annotation property cannot be found@Deprecated public static Set<org.semanticweb.owlapi.model.OWLAnnotation> getStringAnnotations(QuotedEntityChecker checker, String template, String split, String value) throws Exception
checker
- used to resolve the annotation propertytemplate
- the template stringsplit
- the character to split values onvalue
- the value for the annotationRowParseException
- if the annotation property cannot be foundException
@Deprecated public static org.semanticweb.owlapi.model.OWLAnnotation getTypedAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception
checker
- used to resolve the annotation property and datatypetemplate
- the template stringvalue
- the value for the annotationException
- if the annotation property cannot be found@Deprecated public static String processSplit(String template, String cell, List<String> values)
template
- template stringcell
- cell contentsvalues
- empty list to fillCopyright © 2015–2020. All rights reserved.