|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.semwebcentral.sweetrules.sweetonto.SweetDLPSerializers
Field Summary | |
private static java.lang.String |
LINE_BREAK
|
private static java.lang.String |
OWLX_NAMESPACE_PREFIX
|
private static java.lang.String |
RULEML_NAMESPACE_PREFIX
|
private static java.lang.String |
SWEET_DOCTYPE_ENTITYDECLARATION
|
private static java.lang.String |
SWRL_PROPERTY_ATTRIBUTE
|
private static java.lang.String |
SWRLX_NAMESPACE_PREFIX
|
Constructor Summary | |
SweetDLPSerializers()
|
Method Summary | |
private static void |
declareVariables(SweetDLPCompiler compiler,
java.io.Writer writer)
Declares the variables for SWRL |
protected static java.lang.String |
getIndent(int indent)
|
private static java.lang.String |
getOWLXNamespacePrefixWithSeparator()
|
private static java.lang.String |
getRuleMLNamespacePrefixWithSeparator()
|
private static java.lang.String |
getSWRLPropertyAttribute()
|
private static java.lang.String |
getSWRLXNamespacePrefixWithSeparator()
|
private static java.lang.String |
getTermTypeTag(Term term,
SweetLiteralWrapper literal)
|
private static java.lang.String |
getVariableNameOrConstantValue(Term term)
|
static void |
printAsDLV(Program program,
MemoryExtensionalDatabase instancesDatabase,
java.io.PrintWriter writer)
|
static void |
printAsRuleML(Program program,
java.io.PrintWriter writer)
|
static void |
printAsXSB(Program program,
MemoryExtensionalDatabase instancesDatabase,
java.io.PrintWriter writer)
|
protected static void |
printLiteral(Literal literal,
java.io.PrintWriter writer)
|
protected static void |
printRuleMLLiteral(Literal literal,
java.io.PrintWriter writer,
int indent)
|
protected static void |
printTerm(Term term,
java.io.PrintWriter writer)
|
static void |
writeAsRuleML(SweetDLPCompiler compiler,
Program program,
MemoryExtensionalDatabase instancesDatabase,
java.io.Writer writer)
Method to write the program as RuleML output. |
static void |
writeAsSWRL(SweetDLPCompiler compiler,
Program program,
MemoryExtensionalDatabase instancesDatabase,
java.io.Writer writer)
This writes the program as SWRL |
private static void |
writeDocTypeDeclarations(java.lang.String docType,
java.io.Writer writer)
Writes the entity declarations for all namespaces currently seen |
protected static void |
writeRuleMLPredicate(Literal literal,
java.io.Writer writer,
int indent)
Writes a RuleML literal. |
private static void |
writeSWRLPredicate(SweetLiteralWrapper literal,
java.io.Writer writer,
int indent)
Writes a SWRL literal. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String RULEML_NAMESPACE_PREFIX
private static final java.lang.String OWLX_NAMESPACE_PREFIX
private static final java.lang.String SWRLX_NAMESPACE_PREFIX
private static final java.lang.String LINE_BREAK
private static final java.lang.String SWRL_PROPERTY_ATTRIBUTE
private static final java.lang.String SWEET_DOCTYPE_ENTITYDECLARATION
Constructor Detail |
public SweetDLPSerializers()
Method Detail |
public static void printAsDLV(Program program, MemoryExtensionalDatabase instancesDatabase, java.io.PrintWriter writer) throws java.io.IOException
java.io.IOException
public static void printAsXSB(Program program, MemoryExtensionalDatabase instancesDatabase, java.io.PrintWriter writer) throws java.io.IOException
java.io.IOException
protected static void printLiteral(Literal literal, java.io.PrintWriter writer)
protected static void printTerm(Term term, java.io.PrintWriter writer)
public static void writeAsSWRL(SweetDLPCompiler compiler, Program program, MemoryExtensionalDatabase instancesDatabase, java.io.Writer writer) throws java.io.IOException, SweetException, SweetDLPCompilerException
compiler
- The compiler which produced the program (helpful to declare variables)program
- The program to be serialized to SWRLinstancesDatabase
- The instance data of the programwriter
- The writer to write to
java.io.IOException
- if an error occurs
SweetDLPCompilerException
- if input is not in DLP subset
SweetException
private static void writeDocTypeDeclarations(java.lang.String docType, java.io.Writer writer) throws java.io.IOException
docType
- The doc type for the declarationswriter
- The writer to write to
java.io.IOException
- if an error occursprivate static void declareVariables(SweetDLPCompiler compiler, java.io.Writer writer) throws java.io.IOException
compiler
- The compiler which produced the program, and has info about the variables usedwriter
- The writer to write to
java.io.IOException
private static void writeSWRLPredicate(SweetLiteralWrapper literal, java.io.Writer writer, int indent) throws java.io.IOException, SweetException, SweetDLPCompilerException
literal
- The literal to be writtenwriter
- The writer objectindent
- Text to pretty print
java.io.IOException
- if an error occurs
SweetDLPCompilerException
- if input is not in DLP subset
SweetException
public static void writeAsRuleML(SweetDLPCompiler compiler, Program program, MemoryExtensionalDatabase instancesDatabase, java.io.Writer writer) throws java.io.IOException, SweetDLPCompilerException
compiler
- The compiler which produced the programprogram
- The program to writewriter
- The writer into which the target RuleML is to be written
java.io.IOException
- if an error occurs
SweetDLPCompilerException
- if input is not in DLP subsetpublic static void printAsRuleML(Program program, java.io.PrintWriter writer) throws java.io.IOException, SweetDLPCompilerException
java.io.IOException
SweetDLPCompilerException
private static java.lang.String getVariableNameOrConstantValue(Term term) throws SweetException
SweetException
private static java.lang.String getSWRLPropertyAttribute()
private static java.lang.String getRuleMLNamespacePrefixWithSeparator()
private static java.lang.String getOWLXNamespacePrefixWithSeparator()
private static java.lang.String getSWRLXNamespacePrefixWithSeparator()
private static java.lang.String getTermTypeTag(Term term, SweetLiteralWrapper literal) throws SweetException
SweetException
protected static void writeRuleMLPredicate(Literal literal, java.io.Writer writer, int indent) throws java.io.IOException, SweetDLPCompilerException
literal
- The literal to be writtenwriter
- The writer objectindent
- Text to pretty print
java.io.IOException
- if an error occurs
SweetDLPCompilerException
- if input is not in DLP subsetprotected static void printRuleMLLiteral(Literal literal, java.io.PrintWriter writer, int indent) throws java.io.IOException, SweetDLPCompilerException
java.io.IOException
SweetDLPCompilerException
protected static java.lang.String getIndent(int indent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |