public abstract class KWRLProgramParserBase extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
protected Map<String,String> |
namespaces
A map mapping from namespace prefix to namespace URI
|
protected Map<String,ResourceField> |
resources |
protected org.openrdf.model.ValueFactory |
valueFactory |
protected Map<String,VariableField> |
variables |
| Modifier | Constructor and Description |
|---|---|
protected |
KWRLProgramParserBase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
endRule() |
protected ResourceField |
getResource(String uri) |
protected ResourceField |
getResourceByNS(String nsUri) |
protected org.openrdf.model.ValueFactory |
getValueFactory() |
protected VariableField |
getVariable(String name) |
Program |
parseProgram() |
static Program |
parseProgram(String content,
org.openrdf.model.ValueFactory vf)
Short hand for parsing a program from a string using a given value factory.
|
Rule |
parseRule() |
Rule |
parseRule(Map<String,String> namespaces) |
static Rule |
parseRule(String content,
Map<String,String> namespaces,
org.openrdf.model.ValueFactory vf)
Short hand for parsing a rule from a string using a given dictionary of namespaces and a value factory.
|
static Rule |
parseRule(String content,
org.openrdf.model.ValueFactory vf)
Short hand for parsing a rule from a string using a given dictionary of namespaces and a value factory.
|
abstract Program |
Program()
Parse the input as KWRL program.
|
protected org.openrdf.model.Literal |
resolveLiteral(Object content,
Locale loc,
String typeUri) |
protected org.openrdf.model.URI |
resolveResource(String uri) |
abstract Rule |
Rule()
Parse the input as KWRL rule.
|
protected void |
setNamespaces(Map<String,String> namespaces) |
protected void |
setValueFactory(org.openrdf.model.ValueFactory valueFactory) |
protected void |
startRule() |
protected static final org.slf4j.Logger log
protected org.openrdf.model.ValueFactory valueFactory
protected Map<String,VariableField> variables
protected Map<String,ResourceField> resources
protected org.openrdf.model.ValueFactory getValueFactory()
protected void setValueFactory(org.openrdf.model.ValueFactory valueFactory)
public static Program parseProgram(String content, org.openrdf.model.ValueFactory vf) throws ParseException
content - the program represented as stringvf - the value factory to use by the parser for creating resources and literalsParseExceptionpublic static Rule parseRule(String content, org.openrdf.model.ValueFactory vf) throws ParseException
content - the rule represented as string; needs to use fully-qualified URIs for resourcesvf - the value factory to use by the parser for creating resources and literalsParseExceptionpublic static Rule parseRule(String content, Map<String,String> namespaces, org.openrdf.model.ValueFactory vf) throws ParseException
content - the rule represented as stringnamespaces - a map of namespaces, mapping from prefix to namespace URIvf - the value factory to use by the parser for creating resources and literalsParseExceptionpublic Program parseProgram() throws ParseException
ParseExceptionpublic Rule parseRule(Map<String,String> namespaces) throws ParseException
ParseExceptionpublic Rule parseRule() throws ParseException
ParseExceptionprotected org.openrdf.model.URI resolveResource(String uri)
protected org.openrdf.model.Literal resolveLiteral(Object content, Locale loc, String typeUri)
protected VariableField getVariable(String name)
protected ResourceField getResource(String uri)
protected ResourceField getResourceByNS(String nsUri) throws ParseException
ParseExceptionprotected void startRule()
protected void endRule()
public abstract Program Program() throws ParseException
ParseExceptionpublic abstract Rule Rule() throws ParseException
ParseExceptionCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.