You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@rya.apache.org by amihalik <gi...@git.apache.org> on 2017/07/27 14:58:28 UTC

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

GitHub user amihalik opened a pull request:

    https://github.com/apache/incubator-rya/pull/187

    Rya 317 Added Near function for geo mongodb

    (Note this is a continuation of PR #186.  This PR includes additional commits that will be squashed)
    
    ## Description
    >What Changed?
    Changed GeoTupleSet to no long always call GeoWithin
    Create the Geo Indexer properly
    Add GeoNear function for MongoDB and an unsupported exception for accumulo.
    
    ### Tests
    >Coverage?
    Full Near() coverage
    added test to ensure delete works on GEO
    
    ### Links
    [Jira](https://issues.apache.org/jira/browse/RYA-317)
    
    ### Checklist
    - [ ] Code Review
    - [ ] Squash Commits
    
    #### People To Reivew
    @isper3at @meiercaleb 


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/amihalik/incubator-rya RYA-317

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-rya/pull/187.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #187
    
----
commit 168769a5bec213173f47701ebadda842c11c1092
Author: isper3at <sm...@gmail.com>
Date:   2017-07-25T20:15:38Z

    RYA-317 Added Mongo Near support
    
    Support for mongo added.
    fixed so no longer always calls sfWithin
    properly enabled Geo indexer in mongo

commit 0ca7597ff4d0c85a7f233bb1746cf401a81f6725
Author: Aaron Mihalik <mi...@alum.mit.edu>
Date:   2017-07-27T14:54:57Z

    Build Fix

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by amihalik <gi...@git.apache.org>.
Github user amihalik commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    asfbot build


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/295/<h2>Build result: ABORTED</span></h2>[...truncated 7.06 MB...][INFO] Copying 3 resources[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ rya.pcj.fluo.demo ---[INFO] Changes detected - recompiling the module![INFO] Compiling 3 source files to /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.pcj.fluo/pcj.fluo.demo/target/classes[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ rya.pcj.fluo.demo ---[INFO] Using 'UTF-8' encoding to copy filtered resources.[INFO] skip non existing resourceDirectory /home/jenkins/j
 enkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.pcj.fluo/pcj.fluo.demo/src/test/resources[INFO] Copying 3 resourcesBuild was aborted[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ rya.pcj.fluo.demo ---[INFO] No sources to compilechannel stopped[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: hudson.remoting.Channel$OrderlyShutdown[INFO] [INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ rya.pcj.fluo.demo ---Setting status of f12f54690204c9cc154aa91833c15f51e22cc09c to FAILURE with url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/295/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by amihalik <gi...@git.apache.org>.
Github user amihalik closed the pull request at:

    https://github.com/apache/incubator-rya/pull/187


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by amihalik <gi...@git.apache.org>.
Github user amihalik commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    asfbot build


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by meiercaleb <gi...@git.apache.org>.
Github user meiercaleb commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129947290
  
    --- Diff: extras/rya.geoindexing/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoTupleSet.java ---
    @@ -349,6 +371,100 @@ public String toString() {
                 };
             };
     
    +        private final SearchFunction GEO_NEAR = new SearchFunction() {
    +            @Override
    +            public CloseableIteration<Statement, QueryEvaluationException> performSearch(final String queryText,
    +                    final StatementConstraints contraints) throws QueryEvaluationException {
    +                try {
    +                    final String[] args = queryText.split(NEAR_DELIM);
    +                    Optional<Double> maxDistanceOpt = Optional.empty();
    +                    Optional<Double> minDistanceOpt = Optional.empty();
    +                    final String query = args[0];
    +
    +                    for (int ii = 1; ii < args.length; ii++) {
    +                        String numArg = args[ii];
    +
    +                        // remove pre-padding 0's since NumberUtils.isNumber()
    +                        // will assume its octal if it starts with a 0.
    +                        while (numArg.startsWith("0")) {
    +                            numArg = numArg.substring(1);
    +                        }
    +                        // was 0
    +                        if (numArg.equals("")) {
    +                            // if max hasn't been set, set it to 0.
    +                            // Otherwise, min is just ignored.
    +                            if (!maxDistanceOpt.isPresent()) {
    +                                maxDistanceOpt = Optional.of(0.0);
    +                            }
    +                        } else {
    +                            if (!maxDistanceOpt.isPresent() && NumberUtils.isNumber(numArg)) {
    +                                // no variable identifier, going by order.
    +                                maxDistanceOpt = getDistanceOpt(numArg, "maxDistance");
    +                            } else if (NumberUtils.isNumber(numArg)) {
    +                                // no variable identifier, going by order.
    +                                minDistanceOpt = getDistanceOpt(numArg, "minDistance");
    +                            } else {
    +                                throw new IllegalArgumentException(numArg + " is not a valid Near function argument.");
    +                            }
    +                        }
    +                    }
    +                    final WKTReader reader = new WKTReader();
    +                    final Geometry geometry = reader.read(query);
    +                    final NearQuery nearQuery = new NearQuery(maxDistanceOpt, minDistanceOpt, geometry);
    +                    return geoIndexer.queryNear(nearQuery, contraints);
    +                } catch (final ParseException e) {
    +                    throw new QueryEvaluationException(e);
    +                }
    +            }
    +
    +            private Optional<Double> getDistanceOpt(final String num, final String name) {
    +                try {
    +                    return Optional.of(Double.parseDouble(num));
    +                } catch (final NumberFormatException nfe) {
    --- End diff --
    
    Where are you checking to guard against your radii being negative?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/290/<h2>Build result: ABORTED</span></h2>[...truncated 5.20 MB...]	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)2017-07-27 18:38:29,240 INFO  [main-SendThread(localhost:7792)] zookeeper.ClientCnxn (ClientCnxn.java:logStartConnect(975)) - Opening socket connection to server localhost/127.0.0.1:7792. Will not attempt to authenticate using SASL (unknown error)2017-07-27 18:38:29,241 WARN  [main-SendThread(localhost:7792)] zookeeper.ClientCnxn (ClientCnxn.java:run(1102)) - Session 0x15d855653460004 for server null, unexpected error, closing socket connection and attempting reconnectjava.net.ConnectException: Connection refused	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)	at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)	at org.apache.zookeeper.ClientCnxn$Se
 ndThread.run(ClientCnxn.java:1081)Results :Tests run: 312, Failures: 0, Errors: 0, Skipped: 2[ERROR] There was a timeout or other error in the fork[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 22 iota=55[INFO] [INFO] --- animal-sniffer-maven-plugin:1.15:check (default) @ rya.indexing ---[INFO] Checking unresolved references to org.codehaus.mojo.signature:java18:1.0Build was abortedAborted by mihalikchannel stoppedSetting status of 92cc2262fd1bb3dd79284518126431c730104353 to FAILURE with url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/290/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by pujav65 <gi...@git.apache.org>.
Github user pujav65 commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    Sorry-- I'm short on sleep these days and could have sworn it passed.  I won't have time to look today.  I agree with disabling the tests and then asking @jdasch or @meiercaleb to look at it next week
    
    Sent from my iPhone
    
    > On Jul 28, 2017, at 2:28 PM, Aaron Mihalik <no...@github.com> wrote:
    > 
    > @pujav65 The link you sent pointed to a failed build (the grey bulb means it failed). Also, you're right, that configuration doesn't build optional.
    > 
    > I kicked of a job earlier at https://builds.apache.org/job/incubator-rya-fork-with-optionals/23/
    > 
    > That build failed as well. Can you look at the Fluo integration tests and figure out why they are killing the build? I've been working on it for most of today and I'm not getting anywhere. I'm tempted to disable those tests, run them individually, and push a commit to apache master if that all works out.
    > 
    > —
    > You are receiving this because you were mentioned.
    > Reply to this email directly, view it on GitHub, or mute the thread.
    > 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by isper3at <gi...@git.apache.org>.
Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129984814
  
    --- Diff: extras/rya.geoindexing/src/main/java/org/apache/rya/indexing/GeoIndexer.java ---
    @@ -182,4 +183,25 @@
     	 * @return
     	 */
     	public abstract CloseableIteration<Statement, QueryEvaluationException> queryOverlaps(Geometry query, StatementConstraints contraints);
    +	
    +    /**
    +     * Returns statements that contain a geometry that is near the queried {@link Geometry} and meet the {@link StatementConstraints}.
    +     * <p>
    +     * A geometry is considered near if it within the min/max distances specified in the provided {@link NearQuery}.  This will make a disc (specify max),
    +     *  a donut(specify both), or a spheroid complement disc (specify min)
    +     * To specify max/min distances:
    +     * <ul>
    +     * <li>Enter parameters in order MAX, MIN -- Donut</li>
    +     * <li>Omit the MIN -- Disc</li>
    +     * <li>Enter 0 for MAX, and Enter parameter for MIN -- Spheroid complement Dist</li>
    +     * <li>Omit both -- Default max/min [TODO: Find these values]</li>
    --- End diff --
    
    meter, still no idea what the default is


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by isper3at <gi...@git.apache.org>.
Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129984776
  
    --- Diff: extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java ---
    @@ -127,8 +128,9 @@ public String getTableName() {
     
         @Override
         public void deleteStatement(final RyaStatement stmt) throws IOException {
    -       final DBObject obj = storageStrategy.getQuery(stmt);
    -       collection.remove(obj);
    --- End diff --
    
    woops.  used it initially to verify that remove was actually working.  removed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by amihalik <gi...@git.apache.org>.
Github user amihalik commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    asfbot build


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by amihalik <gi...@git.apache.org>.
Github user amihalik commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    asfbot build


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by isper3at <gi...@git.apache.org>.
Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129983982
  
    --- Diff: extras/rya.geoindexing/src/main/java/org/apache/rya/indexing/mongodb/geo/GeoMongoDBStorageStrategy.java ---
    @@ -90,15 +113,18 @@ public GeoMongoDBStorageStrategy(final double maxDistance) {
     
         @Override
         public void createIndices(final DBCollection coll){
    -        coll.createIndex("{" + GEO + " : \"2dsphere\"" );
    --- End diff --
    
    presumably yes, but it didn't really work either.  the BasicDBObject worked though


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by isper3at <gi...@git.apache.org>.
Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129987379
  
    --- Diff: extras/rya.geoindexing/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoTupleSet.java ---
    @@ -349,6 +371,100 @@ public String toString() {
                 };
             };
     
    +        private final SearchFunction GEO_NEAR = new SearchFunction() {
    +            @Override
    +            public CloseableIteration<Statement, QueryEvaluationException> performSearch(final String queryText,
    +                    final StatementConstraints contraints) throws QueryEvaluationException {
    +                try {
    +                    final String[] args = queryText.split(NEAR_DELIM);
    +                    Optional<Double> maxDistanceOpt = Optional.empty();
    +                    Optional<Double> minDistanceOpt = Optional.empty();
    +                    final String query = args[0];
    +
    +                    for (int ii = 1; ii < args.length; ii++) {
    +                        String numArg = args[ii];
    +
    +                        // remove pre-padding 0's since NumberUtils.isNumber()
    +                        // will assume its octal if it starts with a 0.
    +                        while (numArg.startsWith("0")) {
    +                            numArg = numArg.substring(1);
    +                        }
    +                        // was 0
    +                        if (numArg.equals("")) {
    +                            // if max hasn't been set, set it to 0.
    +                            // Otherwise, min is just ignored.
    +                            if (!maxDistanceOpt.isPresent()) {
    +                                maxDistanceOpt = Optional.of(0.0);
    +                            }
    +                        } else {
    +                            if (!maxDistanceOpt.isPresent() && NumberUtils.isNumber(numArg)) {
    +                                // no variable identifier, going by order.
    +                                maxDistanceOpt = getDistanceOpt(numArg, "maxDistance");
    +                            } else if (NumberUtils.isNumber(numArg)) {
    +                                // no variable identifier, going by order.
    +                                minDistanceOpt = getDistanceOpt(numArg, "minDistance");
    +                            } else {
    +                                throw new IllegalArgumentException(numArg + " is not a valid Near function argument.");
    +                            }
    +                        }
    +                    }
    +                    final WKTReader reader = new WKTReader();
    +                    final Geometry geometry = reader.read(query);
    +                    final NearQuery nearQuery = new NearQuery(maxDistanceOpt, minDistanceOpt, geometry);
    +                    return geoIndexer.queryNear(nearQuery, contraints);
    +                } catch (final ParseException e) {
    +                    throw new QueryEvaluationException(e);
    +                }
    +            }
    +
    +            private Optional<Double> getDistanceOpt(final String num, final String name) {
    +                try {
    +                    return Optional.of(Double.parseDouble(num));
    +                } catch (final NumberFormatException nfe) {
    --- End diff --
    
    ok, so it can't be negative.  good catch.  Adding a check for that now 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/293/<h2>Build result: FAILURE</span></h2>[...truncated 899.88 KB...][INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 02:36 min[INFO] Finished at: 2017-07-27T19:41:13+00:00[INFO] Final Memory: 80M/810M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project rya.prospector: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?[ERROR] Command was /bin/sh -c cd /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.prospector && /usr/local/asfpackage
 s/java/jdk1.8.0_144/jre/bin/java -Dfile.encoding=UTF-8 -jar /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.prospector/target/surefire/surefirebooter9199985931916567775.jar /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.prospector/target/surefire/surefire2231593840200276260tmp /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.prospector/target/surefire/surefire_47864515070306959272tmp[ERROR] -> [Help 1][ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException[ERROR] [ERROR] After correcting the problems, you can resume the build wit
 h the command[ERROR]   mvn <goals> -rf :rya.prospectorchannel stoppedSetting status of f12f54690204c9cc154aa91833c15f51e22cc09c to FAILURE with url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/293/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/288/<h2>Build result: ABORTED</span></h2>[...truncated 6.53 MB...][INFO] ------------------------------------------------------------------------[INFO] Building Apache Rya PCJ Fluo Demo 3.2.11-incubating-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ rya.pcj.fluo.demo ---[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- apache-rat-plugin:0.11:check (check-licenses) @ rya.pcj.fluo.demo ---[INFO] 51 implicit excludes (use -debug for more details).[INFO] Exclude: **/resources/META-INF/services/**[INFO] 4 resources included (use -debug for more details)[INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 approved: 4 licence.Build was abortedAborted by mihalik[WARNING] Fai
 led to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-mvn) @ rya.pcj.fluo.demo ---channel stopped[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: hudson.remoting.Channel$OrderlyShutdown[INFO] [INFO] --- maven-remote-resources-plugin:1.5:process (default) @ rya.pcj.fluo.demo ---Setting status of 0ca7597ff4d0c85a7f233bb1746cf401a81f6725 to FAILURE with url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/288/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by meiercaleb <gi...@git.apache.org>.
Github user meiercaleb commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129944714
  
    --- Diff: extras/indexing/src/main/java/org/apache/rya/indexing/mongodb/AbstractMongoIndexer.java ---
    @@ -127,8 +128,9 @@ public String getTableName() {
     
         @Override
         public void deleteStatement(final RyaStatement stmt) throws IOException {
    -       final DBObject obj = storageStrategy.getQuery(stmt);
    -       collection.remove(obj);
    --- End diff --
    
    What's the purpose calling wr.getN()?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by meiercaleb <gi...@git.apache.org>.
Github user meiercaleb commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129955663
  
    --- Diff: extras/rya.geoindexing/src/main/java/org/apache/rya/indexing/GeoIndexer.java ---
    @@ -182,4 +183,25 @@
     	 * @return
     	 */
     	public abstract CloseableIteration<Statement, QueryEvaluationException> queryOverlaps(Geometry query, StatementConstraints contraints);
    +	
    +    /**
    +     * Returns statements that contain a geometry that is near the queried {@link Geometry} and meet the {@link StatementConstraints}.
    +     * <p>
    +     * A geometry is considered near if it within the min/max distances specified in the provided {@link NearQuery}.  This will make a disc (specify max),
    +     *  a donut(specify both), or a spheroid complement disc (specify min)
    +     * To specify max/min distances:
    +     * <ul>
    +     * <li>Enter parameters in order MAX, MIN -- Donut</li>
    +     * <li>Omit the MIN -- Disc</li>
    +     * <li>Enter 0 for MAX, and Enter parameter for MIN -- Spheroid complement Dist</li>
    +     * <li>Omit both -- Default max/min [TODO: Find these values]</li>
    --- End diff --
    
    What is the unit of measurement here?  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/285/<h2>Build result: ABORTED</span></h2>[...truncated 7.03 MB...][INFO] ------------------------------------------------------------------------[INFO] Building Apache Rya PCJ Fluo Demo 3.2.11-incubating-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ rya.pcj.fluo.demo ---[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- apache-rat-plugin:0.11:check (check-licenses) @ rya.pcj.fluo.demo ---[INFO] 51 implicit excludes (use -debug for more details).[INFO] Exclude: **/resources/META-INF/services/**[INFO] 4 resources included (use -debug for more details)[INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 approved: 4 licence.[WARNING] Failed to notify spy hudson.maven.Mave
 n3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-mvn) @ rya.pcj.fluo.demo ---[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- maven-remote-resources-plugin:1.5:process (default) @ rya.pcj.fluo.demo ---Build was abortedAborted by mihalikchannel stoppedSetting status of 0ca7597ff4d0c85a7f233bb1746cf401a81f6725 to FAILURE with url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/285/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by meiercaleb <gi...@git.apache.org>.
Github user meiercaleb commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129956030
  
    --- Diff: extras/rya.geoindexing/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerFilterIT.java ---
    @@ -0,0 +1,266 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.rya.indexing.mongo;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import org.apache.rya.api.domain.RyaStatement;
    +import org.apache.rya.api.resolver.RdfToRyaConversions;
    +import org.apache.rya.api.resolver.RyaToRdfConversions;
    +import org.apache.rya.indexing.GeoConstants;
    +import org.apache.rya.indexing.GeoRyaSailFactory;
    +import org.apache.rya.indexing.OptionalConfigUtils;
    +import org.apache.rya.indexing.accumulo.ConfigUtils;
    +import org.apache.rya.indexing.mongodb.MongoIndexingConfiguration;
    +import org.apache.rya.mongodb.MockMongoFactory;
    +import org.junit.Before;
    +import org.junit.Test;
    +import org.openrdf.model.Resource;
    +import org.openrdf.model.Statement;
    +import org.openrdf.model.URI;
    +import org.openrdf.model.Value;
    +import org.openrdf.model.ValueFactory;
    +import org.openrdf.model.impl.StatementImpl;
    +import org.openrdf.model.impl.ValueFactoryImpl;
    +import org.openrdf.query.BindingSet;
    +import org.openrdf.query.MalformedQueryException;
    +import org.openrdf.query.QueryEvaluationException;
    +import org.openrdf.query.QueryLanguage;
    +import org.openrdf.query.TupleQueryResult;
    +import org.openrdf.repository.sail.SailRepository;
    +import org.openrdf.repository.sail.SailRepositoryConnection;
    +import org.openrdf.sail.Sail;
    +
    +import com.mongodb.MongoClient;
    +import com.vividsolutions.jts.geom.Coordinate;
    +import com.vividsolutions.jts.geom.Geometry;
    +import com.vividsolutions.jts.geom.GeometryFactory;
    +import com.vividsolutions.jts.io.ParseException;
    +import com.vividsolutions.jts.io.WKTReader;
    +import com.vividsolutions.jts.io.WKTWriter;
    +
    +public class MongoGeoIndexerFilterIT {
    +    private static final GeometryFactory GF = new GeometryFactory();
    +    private static final Geometry WASHINGTON_MONUMENT = GF.createPoint(new Coordinate(38.8895, 77.0353));
    +    private static final Geometry LINCOLN_MEMORIAL = GF.createPoint(new Coordinate(38.8893, 77.0502));
    +    private static final Geometry CAPITAL_BUILDING = GF.createPoint(new Coordinate(38.8899, 77.0091));
    +    private static final Geometry WHITE_HOUSE = GF.createPoint(new Coordinate(38.8977, 77.0365));
    +
    +    private MongoClient client;
    +    private Sail sail;
    +    private SailRepositoryConnection conn;
    +
    +    @Before
    +    public void before() throws Exception {
    +        final MongoIndexingConfiguration indxrConf = MongoIndexingConfiguration.builder()
    +            .setMongoCollectionPrefix("rya_")
    +            .setMongoDBName("indexerTests")
    +            .setUseMongoFreetextIndex(false)
    +            .setUseMongoTemporalIndex(false)
    +            .build();
    +
    +        client = MockMongoFactory.newFactory().newMongoClient();
    +        indxrConf.setBoolean(OptionalConfigUtils.USE_GEO, true);
    +        indxrConf.set(ConfigUtils.GEO_PREDICATES_LIST, "http://www.opengis.net/ont/geosparql#asWKT");
    +        indxrConf.setBoolean(ConfigUtils.USE_MONGO, true);
    +        indxrConf.setMongoClient(client);
    +
    +        sail = GeoRyaSailFactory.getInstance(indxrConf);
    +        conn = new SailRepository(sail).getConnection();
    +        conn.begin();
    +    }
    +
    +    @Test
    +    public void nearHappyUsesTest() throws Exception {
    +        populateRya();
    +
    +        //Only captial
    +        String query =
    +             "PREFIX geo: <http://www.opengis.net/ont/geosparql#>\n"
    +           + "PREFIX geof: <http://www.opengis.net/def/function/geosparql/>\n"
    +           + "SELECT * \n" //
    +           + "WHERE { \n"
    +           + "  <urn:geo> geo:asWKT ?point .\n"
    +           + "  FILTER(geof:sfNear(?point, \"POINT(38.8895 77.0353)\"^^geo:wktLiteral, 0.0, 2000))"
    --- End diff --
    
    What does 2000 represent here as the max distance?  This is related to an earlier comment that I had about units.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/291/<h2>Build result: ABORTED</span></h2>[...truncated 7.07 MB...][INFO] ------------------------------------------------------------------------[INFO] Building Apache Rya PCJ Fluo Demo 3.2.11-incubating-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ rya.pcj.fluo.demo ---[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- apache-rat-plugin:0.11:check (check-licenses) @ rya.pcj.fluo.demo ---[INFO] 51 implicit excludes (use -debug for more details).[INFO] Exclude: **/resources/META-INF/services/**Build was abortedAborted by mihalik[INFO] 4 resources included (use -debug for more details)channel stopped[INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 approved: 4 licenc
 e.[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.io.IOException: Backing channel 'channel' is disconnected.[INFO] [INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-mvn) @ rya.pcj.fluo.demo ---[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.io.IOException: Backing channel 'channel' is disconnected.[INFO] [INFO] --- maven-remote-resources-plugin:1.5:process (default) @ rya.pcj.fluo.demo ---Setting status of 92cc2262fd1bb3dd79284518126431c730104353 to FAILURE with url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/291/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by pujav65 <gi...@git.apache.org>.
Github user pujav65 commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    hey @amihalik @meiercaleb @isper3at , this built with no test errors, though I'm not sure if this build skips optionals:
    https://builds.apache.org/job/incubator-rya-fork/26/
    
    I'll kick off another build on the fork with optionals.  It took 3 hours to build! AHH!



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/294/<h2>Build result: FAILURE</span></h2>[...truncated 6.53 MB...][INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 30:12 min[INFO] Finished at: 2017-07-27T20:16:18+00:00[INFO] Final Memory: 150M/1094M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.18.1:integration-test (default) on project rya.pcj.fluo.integration: Execution default of goal org.apache.maven.plugins:maven-failsafe-plugin:2.18.1:integration-test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?[ERROR] Command was /bin/sh -c cd /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.pcj.fluo/pc
 j.fluo.integration && /usr/local/asfpackages/java/jdk1.8.0_144/jre/bin/java -jar /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.pcj.fluo/pcj.fluo.integration/target/surefire/surefirebooter6966476237704401947.jar /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.pcj.fluo/pcj.fluo.integration/target/surefire/surefire302952478541069939tmp /home/jenkins/jenkins-slave/workspace/incubator-rya-master-with-optionals-pull-requests/extras/rya.pcj.fluo/pcj.fluo.integration/target/surefire/surefire_6834138871477277758tmp[ERROR] -> [Help 1][ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionExceptio
 n[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :rya.pcj.fluo.integrationchannel stoppedSetting status of f12f54690204c9cc154aa91833c15f51e22cc09c to FAILURE with url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/294/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by meiercaleb <gi...@git.apache.org>.
Github user meiercaleb commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129949331
  
    --- Diff: extras/rya.geoindexing/src/main/java/org/apache/rya/indexing/mongodb/geo/GeoMongoDBStorageStrategy.java ---
    @@ -90,15 +113,18 @@ public GeoMongoDBStorageStrategy(final double maxDistance) {
     
         @Override
         public void createIndices(final DBCollection coll){
    -        coll.createIndex("{" + GEO + " : \"2dsphere\"" );
    --- End diff --
    
    What was the issue here?  We were missing "}" after 2dsphere?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    
    Refer to this link for build results (access rights to CI server needed): 
    https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/286/<h2>Build result: ABORTED</span></h2>[...truncated 6.52 MB...][INFO] ------------------------------------------------------------------------[INFO] Building Apache Rya PCJ Fluo Demo 3.2.11-incubating-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ rya.pcj.fluo.demo ---[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- apache-rat-plugin:0.11:check (check-licenses) @ rya.pcj.fluo.demo ---[INFO] 51 implicit excludes (use -debug for more details).[INFO] Exclude: **/resources/META-INF/services/**[INFO] 4 resources included (use -debug for more details)[INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 approved: 4 licence.[WARNING] Failed to notify spy hudson.maven.Mave
 n3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-mvn) @ rya.pcj.fluo.demo ---Build was abortedAborted by mihalik[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 12 iota=55[INFO] [INFO] --- maven-remote-resources-plugin:1.5:process (default) @ rya.pcj.fluo.demo ---channel stoppedSetting status of 0ca7597ff4d0c85a7f233bb1746cf401a81f6725 to FAILURE with url https://builds.apache.org/job/incubator-rya-master-with-optionals-pull-requests/286/ and message: 'FAILURE 'Using context: Jenkins: clean package -Pgeoindexing



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by isper3at <gi...@git.apache.org>.
Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129984635
  
    --- Diff: extras/rya.geoindexing/src/main/java/org/apache/rya/indexing/accumulo/geo/GeoTupleSet.java ---
    @@ -349,6 +371,100 @@ public String toString() {
                 };
             };
     
    +        private final SearchFunction GEO_NEAR = new SearchFunction() {
    +            @Override
    +            public CloseableIteration<Statement, QueryEvaluationException> performSearch(final String queryText,
    +                    final StatementConstraints contraints) throws QueryEvaluationException {
    +                try {
    +                    final String[] args = queryText.split(NEAR_DELIM);
    +                    Optional<Double> maxDistanceOpt = Optional.empty();
    +                    Optional<Double> minDistanceOpt = Optional.empty();
    +                    final String query = args[0];
    +
    +                    for (int ii = 1; ii < args.length; ii++) {
    +                        String numArg = args[ii];
    +
    +                        // remove pre-padding 0's since NumberUtils.isNumber()
    +                        // will assume its octal if it starts with a 0.
    +                        while (numArg.startsWith("0")) {
    +                            numArg = numArg.substring(1);
    +                        }
    +                        // was 0
    +                        if (numArg.equals("")) {
    +                            // if max hasn't been set, set it to 0.
    +                            // Otherwise, min is just ignored.
    +                            if (!maxDistanceOpt.isPresent()) {
    +                                maxDistanceOpt = Optional.of(0.0);
    +                            }
    +                        } else {
    +                            if (!maxDistanceOpt.isPresent() && NumberUtils.isNumber(numArg)) {
    +                                // no variable identifier, going by order.
    +                                maxDistanceOpt = getDistanceOpt(numArg, "maxDistance");
    +                            } else if (NumberUtils.isNumber(numArg)) {
    +                                // no variable identifier, going by order.
    +                                minDistanceOpt = getDistanceOpt(numArg, "minDistance");
    +                            } else {
    +                                throw new IllegalArgumentException(numArg + " is not a valid Near function argument.");
    +                            }
    +                        }
    +                    }
    +                    final WKTReader reader = new WKTReader();
    +                    final Geometry geometry = reader.read(query);
    +                    final NearQuery nearQuery = new NearQuery(maxDistanceOpt, minDistanceOpt, geometry);
    +                    return geoIndexer.queryNear(nearQuery, contraints);
    +                } catch (final ParseException e) {
    +                    throw new QueryEvaluationException(e);
    +                }
    +            }
    +
    +            private Optional<Double> getDistanceOpt(final String num, final String name) {
    +                try {
    +                    return Optional.of(Double.parseDouble(num));
    +                } catch (final NumberFormatException nfe) {
    --- End diff --
    
    I'll do a quick test for it, if it doesn't break I don't see why we should do anything.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by amihalik <gi...@git.apache.org>.
Github user amihalik commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    @pujav65 The link you sent pointed to a failed build (the grey bulb means it failed).  Also, you're right, that configuration doesn't build optional.
    
    I kicked of a job earlier at https://builds.apache.org/job/incubator-rya-fork-with-optionals/23/
    
    That build failed as well.  Can you look at the Fluo integration tests and figure out why they are killing the build?  I've been working on it for most of today and I'm not getting anywhere.  I'm tempted to disable those tests, run them individually, and push a commit to apache master if that all works out.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya pull request #187: Rya 317 Added Near function for geo mongodb

Posted by isper3at <gi...@git.apache.org>.
Github user isper3at commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/187#discussion_r129985187
  
    --- Diff: extras/rya.geoindexing/src/test/java/org/apache/rya/indexing/mongo/MongoGeoIndexerFilterIT.java ---
    @@ -0,0 +1,266 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.rya.indexing.mongo;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +import org.apache.rya.api.domain.RyaStatement;
    +import org.apache.rya.api.resolver.RdfToRyaConversions;
    +import org.apache.rya.api.resolver.RyaToRdfConversions;
    +import org.apache.rya.indexing.GeoConstants;
    +import org.apache.rya.indexing.GeoRyaSailFactory;
    +import org.apache.rya.indexing.OptionalConfigUtils;
    +import org.apache.rya.indexing.accumulo.ConfigUtils;
    +import org.apache.rya.indexing.mongodb.MongoIndexingConfiguration;
    +import org.apache.rya.mongodb.MockMongoFactory;
    +import org.junit.Before;
    +import org.junit.Test;
    +import org.openrdf.model.Resource;
    +import org.openrdf.model.Statement;
    +import org.openrdf.model.URI;
    +import org.openrdf.model.Value;
    +import org.openrdf.model.ValueFactory;
    +import org.openrdf.model.impl.StatementImpl;
    +import org.openrdf.model.impl.ValueFactoryImpl;
    +import org.openrdf.query.BindingSet;
    +import org.openrdf.query.MalformedQueryException;
    +import org.openrdf.query.QueryEvaluationException;
    +import org.openrdf.query.QueryLanguage;
    +import org.openrdf.query.TupleQueryResult;
    +import org.openrdf.repository.sail.SailRepository;
    +import org.openrdf.repository.sail.SailRepositoryConnection;
    +import org.openrdf.sail.Sail;
    +
    +import com.mongodb.MongoClient;
    +import com.vividsolutions.jts.geom.Coordinate;
    +import com.vividsolutions.jts.geom.Geometry;
    +import com.vividsolutions.jts.geom.GeometryFactory;
    +import com.vividsolutions.jts.io.ParseException;
    +import com.vividsolutions.jts.io.WKTReader;
    +import com.vividsolutions.jts.io.WKTWriter;
    +
    +public class MongoGeoIndexerFilterIT {
    +    private static final GeometryFactory GF = new GeometryFactory();
    +    private static final Geometry WASHINGTON_MONUMENT = GF.createPoint(new Coordinate(38.8895, 77.0353));
    +    private static final Geometry LINCOLN_MEMORIAL = GF.createPoint(new Coordinate(38.8893, 77.0502));
    +    private static final Geometry CAPITAL_BUILDING = GF.createPoint(new Coordinate(38.8899, 77.0091));
    +    private static final Geometry WHITE_HOUSE = GF.createPoint(new Coordinate(38.8977, 77.0365));
    +
    +    private MongoClient client;
    +    private Sail sail;
    +    private SailRepositoryConnection conn;
    +
    +    @Before
    +    public void before() throws Exception {
    +        final MongoIndexingConfiguration indxrConf = MongoIndexingConfiguration.builder()
    +            .setMongoCollectionPrefix("rya_")
    +            .setMongoDBName("indexerTests")
    +            .setUseMongoFreetextIndex(false)
    +            .setUseMongoTemporalIndex(false)
    +            .build();
    +
    +        client = MockMongoFactory.newFactory().newMongoClient();
    +        indxrConf.setBoolean(OptionalConfigUtils.USE_GEO, true);
    +        indxrConf.set(ConfigUtils.GEO_PREDICATES_LIST, "http://www.opengis.net/ont/geosparql#asWKT");
    +        indxrConf.setBoolean(ConfigUtils.USE_MONGO, true);
    +        indxrConf.setMongoClient(client);
    +
    +        sail = GeoRyaSailFactory.getInstance(indxrConf);
    +        conn = new SailRepository(sail).getConnection();
    +        conn.begin();
    +    }
    +
    +    @Test
    +    public void nearHappyUsesTest() throws Exception {
    +        populateRya();
    +
    +        //Only captial
    +        String query =
    +             "PREFIX geo: <http://www.opengis.net/ont/geosparql#>\n"
    +           + "PREFIX geof: <http://www.opengis.net/def/function/geosparql/>\n"
    +           + "SELECT * \n" //
    +           + "WHERE { \n"
    +           + "  <urn:geo> geo:asWKT ?point .\n"
    +           + "  FILTER(geof:sfNear(?point, \"POINT(38.8895 77.0353)\"^^geo:wktLiteral, 0.0, 2000))"
    --- End diff --
    
    2000 is an arbitrary distance so as the points specified between 0 and 2k meters are not returned.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-rya issue #187: Rya 317 Added Near function for geo mongodb

Posted by amihalik <gi...@git.apache.org>.
Github user amihalik commented on the issue:

    https://github.com/apache/incubator-rya/pull/187
  
    asfbot build


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---