|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.samples.SampleCode
public class SampleCode
Demonstrate how to use bigdata. You are free to use this code for whatever purpose without restriction.
| Field Summary | |
|---|---|
protected static org.apache.log4j.Logger |
log
Do you have log4j set up correctly? Bigdata turns its logging level way down by default (WARN). |
| Constructor Summary | |
|---|---|
SampleCode()
|
|
| Method Summary | |
|---|---|
protected void |
compare(TupleQueryResult result,
Collection<BindingSet> answer)
|
protected BindingSet |
createBindingSet(Binding... bindings)
|
void |
doLUBMTest(String lubmResource)
Run a simple LUBM load and query benchmark. |
void |
doU1()
|
void |
doU10()
|
void |
executeConstructQuery(Repository repo,
String query,
QueryLanguage ql)
Execute a "construct" query. |
boolean |
executeFreeTextQuery(Repository repo)
Demonstrate execution of a free-text query. |
void |
executeHistoricalQuery(Repository repo)
Demonstrate execution of historical query using a read-only transaction. |
boolean |
executeProvenanceQuery(Repository repo)
Demonstrate execution of statement level provenance. |
void |
executeSelectQuery(Repository repo,
String query,
QueryLanguage ql)
Execute a "select" query. |
Reader |
getReader(Class c,
String resource)
|
Properties |
loadProperties(String resource)
Load a Properties object from a file. |
void |
loadSomeData(Repository repo)
Add a statement to a repository. |
void |
loadSomeDataFromADocument(Repository repo,
String resource,
String baseURL)
Load a document into a repository. |
static void |
main(String[] args)
Are you running with the -server JVM option? You should be. |
void |
readSomeData(Repository repo,
URI uri)
Read some statements from a repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger log
| Constructor Detail |
|---|
public SampleCode()
| Method Detail |
|---|
public Properties loadProperties(String resource)
throws Exception
resource -
Exception
public void loadSomeData(Repository repo)
throws Exception
repo -
Exception
public void loadSomeDataFromADocument(Repository repo,
String resource,
String baseURL)
throws Exception
repo - resource - baseURL -
Exception
public void readSomeData(Repository repo,
URI uri)
throws Exception
repo - uri -
Exception
public void executeSelectQuery(Repository repo,
String query,
QueryLanguage ql)
throws Exception
repo - query - ql -
Exception
public void executeConstructQuery(Repository repo,
String query,
QueryLanguage ql)
throws Exception
repo - query - ql -
Exception
public boolean executeFreeTextQuery(Repository repo)
throws Exception
repo -
Exception
public boolean executeProvenanceQuery(Repository repo)
throws Exception
repo -
Exception
public void executeHistoricalQuery(Repository repo)
throws Exception
Note: Bigdata preserves historical commit points until their release age
expires. This behavior is controlled by the deployment mode (RW, WORM, or
cluster) and by
AbstractTransactionService.Options#MIN_RELEASE_AGE. Except for
the WORM deployment mode, you MUST guard a historical commit point on
which you want to read using a read-lock. The read-lock itself is just a
read-only connection. It can be obtained for any historical commit point
that you want to "pin" and can be released once you are no longer need to
"pin" that commit point.
The read-lock is not required for the WORM deployment because it never releases historical commit points.
repo -
Exception
public void doLUBMTest(String lubmResource)
throws Exception
lubmResource - the ZIP file containing the LUBM data filesfilter - helps filter out non-data files in the ZIP file
Exception
public void doU10()
throws Exception
Exception
public void doU1()
throws Exception
Exception
public Reader getReader(Class c,
String resource)
public static void main(String[] args)
args - protected BindingSet createBindingSet(Binding... bindings)
protected void compare(TupleQueryResult result,
Collection<BindingSet> answer)
throws QueryEvaluationException
QueryEvaluationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||