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 literalsParseException
public 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 literalsParseException
public 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 literalsParseException
public Program parseProgram() throws ParseException
ParseException
public Rule parseRule(Map<String,String> namespaces) throws ParseException
ParseException
public Rule parseRule() throws ParseException
ParseException
protected 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
ParseException
protected void startRule()
protected void endRule()
public abstract Program Program() throws ParseException
ParseException
public abstract Rule Rule() throws ParseException
ParseException
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.