From: <tho...@us...> - 2014-02-20 21:14:58
|
Revision: 7862 http://sourceforge.net/p/bigdata/code/7862 Author: thompsonbry Date: 2014-02-20 21:14:56 +0000 (Thu, 20 Feb 2014) Log Message: ----------- javadoc Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-02-20 21:14:41 UTC (rev 7861) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-02-20 21:14:56 UTC (rev 7862) @@ -82,12 +82,12 @@ * PREFIX gas <http://www.bigdata.com/rdf/gas#> * #... * SERVICE <GAS> { - * gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" - * gas:program gas:in <IRI> # one or more times, specifies the initial frontier. - * gas:program gas:out ?out # exactly once - will be bound to the visited vertices. - * gas:program gas:maxIterations 4 # optional limit on breadth first expansion. - * gas:program gas:maxVisited 2000 # optional limit on the #of visited vertices. - * gas:program gas:nthreads 4 # specify the #of threads to use (optional) + * gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" . + * gas:program gas:in <IRI> . # one or more times, specifies the initial frontier. + * gas:program gas:out ?out . # exactly once - will be bound to the visited vertices. + * gas:program gas:maxIterations 4 . # optional limit on breadth first expansion. + * gas:program gas:maxVisited 2000 . # optional limit on the #of visited vertices. + * gas:program gas:nthreads 4 . # specify the #of threads to use (optional) * } * </pre> * @@ -97,12 +97,12 @@ * PREFIX gas <http://www.bigdata.com/rdf/gas#> * #... * SERVICE <GAS> { - * gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.FuzzySSSP" - * gas:program gas:in <IRI> # one or more times, specifies the initial frontier. - * gas:program gas:target <IRI> # one or more times, identifies the target vertices and hence the paths of interest. - * gas:program gas:out ?out # exactly once - will be bound to the visited vertices laying within N-hops of the shortest paths. - * gas:program gas:maxIterations 4 # optional limit on breadth first expansion. - * gas:program gas:maxVisited 2000 # optional limit on the #of visited vertices. + * gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.FuzzySSSP" . + * gas:program gas:in <IRI> . # one or more times, specifies the initial frontier. + * gas:program gas:target <IRI> . # one or more times, identifies the target vertices and hence the paths of interest. + * gas:program gas:out ?out . # exactly once - will be bound to the visited vertices laying within N-hops of the shortest paths. + * gas:program gas:maxIterations 4 . # optional limit on breadth first expansion. + * gas:program gas:maxVisited 2000 . # optional limit on the #of visited vertices. * } * </pre> * @@ -114,8 +114,16 @@ * * TODO The input frontier could be a variable, in which case we would pull out * the column for that variable rather than running the algorithm once per - * source binding set, right? Or maybe not. + * source binding set, right? Or maybe not. * + * TODO Allow {@link IReducer} that binds the visited vertex and also the + * dynamic state associated with that vertex. For BFS and SSSP, this could be + * depth/distance and the predecessor (for path information). For BFS and SSSP, + * we could also have a specific target vertex (or vertices) and then report out + * the path for that vertex/vertices. This would significantly reduce the data + * reported back. (Could we run SSSP in both directions to accelerate the + * convergence?) + * * TODO Also support export. This could be easily done using a SPARQL SELECT * * <pre> @@ -655,6 +663,7 @@ } + // Run the analytic. final IGASStats stats = (IGASStats) gasContext.call(); if (log.isInfoEnabled()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-02-23 00:18:43
|
Revision: 7874 http://sourceforge.net/p/bigdata/code/7874 Author: thompsonbry Date: 2014-02-23 00:18:40 +0000 (Sun, 23 Feb 2014) Log Message: ----------- Since I committed the change to extract depth from BFS, I just made that code conditional so it will not break other algorithms (e.g., SSSP). This still needs to be abstracted correctly so it will report the "state". I think that the right approach might be to hand the IGASProgram the binding set and ordered list of variables (out, out1, out2) and let it create the bindings as appropriate for that algorithm. Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-02-23 00:14:26 UTC (rev 7873) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-02-23 00:18:40 UTC (rev 7874) @@ -755,7 +755,7 @@ if (outVar != null) { vals[j++] = new Constant(v); } - if (stateVar != null) { + if (stateVar != null && gasProgram instanceof BFS) { /* * FIXME Need an API for self-reporting of an IV by * the IGASProgram. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2014-03-11 19:00:42
|
Revision: 7928 http://sourceforge.net/p/bigdata/code/7928 Author: thompsonbry Date: 2014-03-11 19:00:37 +0000 (Tue, 11 Mar 2014) Log Message: ----------- Bug fix to the GASService when multiple in vertices were specified. It was initializing the new frontier in a loop, but the frontier was being reset before each value was inserted.... Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-03-11 18:57:20 UTC (rev 7927) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-03-11 19:00:37 UTC (rev 7928) @@ -748,22 +748,27 @@ if (initialFrontier != null) { + /* + * FIXME Why can't we pass in the Value (with a defined IV) + * and not the IV? This should work. Passing in the IV is + * against the grain of the API and the generalized + * abstraction as Values. Of course, having the IV is + * necessary since this is an internal, high performance, + * and close to the indices operation. + */ + final IV[] tmp = new IV[initialFrontier.length]; + // Setup the initial frontier. + int i = 0; for (Value startingVertex : initialFrontier) { - /* - * FIXME Why can't we pass in the Value (with a defined - * IV) and not the IV? This should work. Passing in the - * IV is against the grain of the API and the - * generalized abstraction as Values. Of course, having - * the IV is necessary since this is an internal, high - * performance, and close to the indices operation. - */ - gasState.setFrontier(gasContext, - ((BigdataValue) startingVertex).getIV()); + tmp[i++] = ((BigdataValue) startingVertex).getIV(); } + // set the frontier. + gasState.setFrontier(gasContext, tmp); + } // Run the analytic. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrp...@us...> - 2014-04-03 22:01:35
|
Revision: 8039 http://sourceforge.net/p/bigdata/code/8039 Author: mrpersonick Date: 2014-04-03 22:01:30 +0000 (Thu, 03 Apr 2014) Log Message: ----------- allow strings to be produced as output and bound to outvars Modified Paths: -------------- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java Modified: branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java =================================================================== --- branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-04-03 21:32:58 UTC (rev 8038) +++ branches/RDR/bigdata-rdf/src/java/com/bigdata/rdf/graph/impl/bd/GASService.java 2014-04-03 22:01:30 UTC (rev 8039) @@ -67,6 +67,7 @@ import com.bigdata.rdf.model.BigdataValue; import com.bigdata.rdf.model.BigdataValueImpl; import com.bigdata.rdf.sail.BigdataSail.BigdataSailConnection; +import com.bigdata.rdf.sparql.ast.DummyConstantNode; import com.bigdata.rdf.sparql.ast.GraphPatternGroup; import com.bigdata.rdf.sparql.ast.IGroupMemberNode; import com.bigdata.rdf.sparql.ast.StatementPatternNode; @@ -1037,10 +1038,22 @@ final IV<BigdataValueImpl, ?> iv = lex .getLexiconConfiguration().createInlineIV(val); - iv.setValue((BigdataValueImpl) val); + if (iv != null) { - bs.set(var, new Constant(iv)); + iv.setValue((BigdataValueImpl) val); + bs.set(var, new Constant(iv)); + + } else if (val instanceof BigdataValue) { + + bs.set(var, new Constant(DummyConstantNode.toDummyIV((BigdataValue) val))); + + } else { + + throw new RuntimeException("FIXME"); + + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |