[
https://issues.apache.org/jira/browse/RYA-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15798861#comment-15798861
]
David W. Lotts commented on RYA-83:
-----------------------------------
The issue is that there is no TriplePatternStrategy that handles() this case.
That is why it is not supported. Below are instructions for supporting this
case.
The error is thrown here:
rya/dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java
line 142
{code}
strategy = ryaContext.retrieveStrategy(stmt);
if (strategy == null) {
throw new IllegalArgumentException("TriplePattern[" + stmt
+ "] not supported");
}
{code}
The strategy is TABLE_LAYOUT and the scan range.
The TABLE_LAYOUT is which table it scans to match the statement pattern: SPO,
POS, or OSP, and
the scan range is a start and stop byte[] range for scanning that table.
Here is how to support this case. Please make these changes, test, and submit
a pull request to the Rya project:
1. Copy class SpoWholeRowTriplePatternStrategy to NullRowTriplePatternStrategy,
/rya.api/src/main/java/org/apache/rya/api/query/strategy/wholerow/SpoWholeRowTriplePatternStrategy.java
2. fix the handle() method so that it returns true for all null parameters, and
3. replace the defineRange() with this:
{code}
defineRange(...) {
start = new Byte[] { /* empty array */ }; // Scan from the
beginning of the Accumulo table.
stop = LAST_BYTES; // Scan to the end, up through things
beginning with 0xff.
return new RdfCloudTripleStoreUtils.CustomEntry<TABLE_LAYOUT,
ByteRange>(TABLE_LAYOUT.SPO, new ByteRange(start, stop));
}
{code}
Then add a new instance of NullRowTriplePatternStrategy in method:
org.apache.rya.api.resolver.RyaTripleContext.addDefaultTriplePatternStrategies(boolean)
And your done!
There might be some oddness about creating a range with an empty start array.
Might be better to skip the range when creating the scanner.
> select * where { s? p? o? } query crashed
> -----------------------------------------
>
> Key: RYA-83
> URL: https://issues.apache.org/jira/browse/RYA-83
> Project: Rya
> Issue Type: Bug
> Environment: Accumulo 1.6.5 installed on EMR 4.6.0 (Hadoop 2.6.0)
> Reporter: Kiet Ly
> Assignee: David W. Lotts
>
> I ran this query using REST
> http://10.162.96.61:8000/web.rya/queryrdf?query=select * where { ?s ?p ?o }
> and it crashed. I just want to see the triples that I had inserted. I ran the
> query against the RYA I built from develop branch with accumulo 1.6.5.
> The error indicate this query is not supported, "select * where { ?s ?p ?o
> }".
> {code}
> java.lang.IllegalArgumentException: TriplePattern[RyaStatement{subject=null,
> predicate=null, object=null, context=null, qualifier=null,
> columnVisibility=null, value=null, timestamp=1465307441120}] not supported
>
> mvm.rya.accumulo.query.AccumuloRyaQueryEngine.queryWithBindingSet(AccumuloRyaQueryEngine.java:142)
>
> mvm.rya.accumulo.query.AccumuloRyaQueryEngine.queryWithBindingSet(AccumuloRyaQueryEngine.java:81)
> mvm.rya.api.persist.utils.RyaDAOHelper.query(RyaDAOHelper.java:122)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)