|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umbc.cs.daml4jess.D4jUtil
A set of Daml4Jess util methods.
Constructor Summary | |
D4jUtil()
|
Method Summary | |
static java.lang.String |
array2String(java.lang.Object[] array,
int ipl)
Convert the given object array to string, using default element separator: ", ". |
static java.lang.String |
array2String(java.lang.Object[] array,
int ipl,
java.lang.String delim)
Convert the given object array to string. |
static java.lang.String |
buildAnonymousFact(java.lang.String value)
Build an anonymous, ordered fact with the given value, in the form: ( |
static java.lang.String |
buildAsserts(java.lang.String facts)
Construct a Jess "assert" statement with the given facts. |
static java.lang.String |
buildDeffacts(java.lang.String facts)
Construct a Jess "deffacts" statement with the given facts. |
static java.lang.String |
buildRdfFact(java.lang.String subj,
java.lang.String pred,
java.lang.String obj)
Build an RDF Jess fact with the given subject, predicate, and object. |
static java.lang.String |
canonicalizeUri(java.lang.String uri)
Canonicalize a resource URI (to be used to load the resource). |
static java.lang.String |
dependencyFact(java.lang.String depId,
java.lang.String seqId)
create a dependency fact, a fact to be used as logical CE in Jess rule, so that when this fact is retracted, all facts asserted via the rule will automatically retracted. |
static java.lang.String |
dependencyRule(java.lang.String ruleName,
java.lang.String depFact,
java.lang.String facts)
create a dependency rule, with the given rule name, dependency fact, and the facts depending on the dependency fact and to be asserted. |
static java.lang.String |
dependencyRuleName(java.lang.String depId,
java.lang.String seqId)
Create a dependency rule name with the given dependency id and sequenceid. |
static java.lang.String |
dumpJessQueryResults(java.util.Iterator iter)
Dump the given query results (in the iterator) to a string. |
static java.lang.String |
factListToString(java.util.List facts)
Convert a given list of facts into one string, a newline is inserted after each fact. |
static java.lang.String |
getStackTrace(java.lang.Throwable t)
Get the stack trace of the given throwable. |
static java.lang.String |
getUniqueId(java.lang.String prefix)
Generate a unique id with the given prefix. |
static java.lang.String |
toJessQuery(java.lang.String queryName,
java.lang.String[] args)
Write the given query name and arguments into Jess run-query format, e.g., (run-query |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public D4jUtil()
Method Detail |
public static java.lang.String getUniqueId(java.lang.String prefix)
public static java.lang.String getStackTrace(java.lang.Throwable t)
t
- the given throwable whose stack trace is to be retrieved.
public static java.lang.String array2String(java.lang.Object[] array, int ipl)
array
- the array to be converted to a string.ipl
- items per line. If ipl = 0, all items will be on one line.public static java.lang.String array2String(java.lang.Object[] array, int ipl, java.lang.String delim)
array
- the array to be converted to a string.ipl
- items per line. If ipl = 0, all items will be on one line.delim
- the array item deliminator.public static java.lang.String canonicalizeUri(java.lang.String uri) throws D4jException
uri
- the uri to be "canonicalized".
D4jException
- if the given uri can not be canonicalized.public static java.lang.String buildRdfFact(java.lang.String subj, java.lang.String pred, java.lang.String obj)
public static java.lang.String buildAnonymousFact(java.lang.String value)
value
- the value of the only place in the fact.public static java.lang.String buildDeffacts(java.lang.String facts)
public static java.lang.String buildAsserts(java.lang.String facts)
public static java.lang.String dependencyFact(java.lang.String depId, java.lang.String seqId)
depId
- the dependency id.seqId
- the sequence id (number) with respect to the public static java.lang.String dependencyRuleName(java.lang.String depId, java.lang.String seqId)
depId
- the dependency id.seqId
- the sequence id (number) with respect to the public static java.lang.String dependencyRule(java.lang.String ruleName, java.lang.String depFact, java.lang.String facts)
ruleName
- the dependency rule name.depFact
- the fact the given facts depend on.facts
- the facts to be asserted with dependency.public static java.lang.String factListToString(java.util.List facts)
facts
- a list of facts.
public static java.lang.String dumpJessQueryResults(java.util.Iterator iter)
iter
- the iterator of the query results.
public static java.lang.String toJessQuery(java.lang.String queryName, java.lang.String[] args)
queryName
- name of the query.args
- the argument list, if any.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |