本文整理汇总了Java中org.apache.jena.atlas.lib.DS类的典型用法代码示例。如果您正苦于以下问题:Java DS类的具体用法?Java DS怎么用?Java DS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DS类属于org.apache.jena.atlas.lib包,在下文中一共展示了DS类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
@Override
public RowList<NodeId> execute(RowList<NodeId> input) {
// Ignore input.
JoinKey joinKey = JoinKey.create(mergeStep.getVar()) ;
Set<Var> vars = DS.setOfOne(mergeStep.getVar()) ;
RowList<NodeId> left = find(mergeStep.getIndex1(), mergeStep.getPattern1(), vars) ;
RowList<NodeId> right = find(mergeStep.getIndex2(), mergeStep.getPattern2(), vars) ;
RowBuilder<NodeId> builder = new RowBuilderBase<NodeId>() ;
return Join.mergeJoin(joinKey, left, right, comparator, builder) ;
}
示例2: convertTriples
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
public static List<Tuple<Slot<NodeId>>> convertTriples(List<Triple> triples, NodeTable nodeTable, boolean allocate) {
List<Tuple<Slot<NodeId>>> x = DS.list() ;
for ( Triple t : triples ) {
Tuple<Slot<NodeId>> ts = convert(t, nodeTable, allocate) ;
if ( ts == null )
return null ;
x.add(ts) ;
}
return x ;
}
示例3: convertQuads
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
public static List<Tuple<Slot<NodeId>>> convertQuads(List<Quad> quads, NodeTable nodeTable, boolean allocate) {
List<Tuple<Slot<NodeId>>> x = DS.list() ;
for ( Quad q : quads ) {
Tuple<Slot<NodeId>> ts = convert(q, nodeTable, allocate) ;
if ( ts == null )
return null ;
x.add(ts) ;
}
return x ;
}
示例4: create
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
/** Make a JoinKey from the intersection of two sets **/
public static JoinKey create(Collection<Var> vars1, Collection<Var> vars2) {
//JoinKeys are generally small so short loops are best.
// vars2 may be smallest e.g. from triple and running accumulator (vars1)
List<Var> intersection = DS.list() ;
for ( Var v : vars1 ) {
if ( vars2.contains(v) )
intersection.add(v) ;
}
return new JoinKey(intersection) ;
}
示例5: vars
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
/** Vars from a tuple */
public static <X> Set<Var> vars(Tuple<Slot<X>> tuple) {
Set<Var> x = DS.set() ;
for ( Slot<X> s : tuple ) {
if ( s.isVar() && ! x.contains(s.var) )
x.add(s.var) ;
}
return x ;
}
示例6: substitutionJoin
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
public static <X> RowList<X> substitutionJoin(RowList<X> left, Tuple<Slot<X>> pattern, AccessRows<X> accessor, RowBuilder<X> builder) {
Iterator<Row<X>> iter = new SubstituteApply<X>(accessor, pattern, left.iterator(), builder) ;
Set<Var> vars = null ;
if ( left.vars() != null ) {
vars = DS.set() ;
vars.addAll(left.vars()) ;
EngLib.accVars(vars, pattern) ;
}
return RowLib.createRowList(vars, iter) ;
}
示例7: innerLoopJoinBasic
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
/** Simple, materializing version - useful for debugging */
public static <X> RowList<X> innerLoopJoinBasic(RowList<X> leftTable, RowList<X> rightTable, RowBuilder<X> builder) {
Set<Var> vars = SetUtils.union(leftTable.vars(), rightTable.vars()) ;
Iterable<Row<X>> leftRows = leftTable.toList() ;
List<Row<X>> output = DS.list() ;
for ( Row<X> row2 : rightTable ) {
for ( Row<X> row1 : leftRows ) {
if ( Join.compatible(row1, row2) ) {
builder.reset() ;
output.add(Join.merge(row1, row2, builder)) ;
}
}
}
return RowLib.createRowList(vars, output.iterator()) ;
}
示例8: build
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
public JoinKey build() {
JoinKey joinKey = new JoinKey(DS.list(keys)) ;
return joinKey ;
}
示例9: JoinKey
import org.apache.jena.atlas.lib.DS; //导入依赖的package包/类
private JoinKey(Var var) { keys = DS.listOfOne(var) ; }