Package lupos.datastructures.items

Examples of lupos.datastructures.items.Item


@Namespace(value = "http://www.w3.org/2007/rif-builtin-predicate#")
public class NonStandardPredicates {
  @Builtin(Name = "is-literal")
  public static BooleanLiteral is_literal(Argument arg) {
    Item arg0 = arg.arguments.get(0);
    if(arg0 instanceof LazyLiteral){
      arg0 = ((LazyLiteral) arg0).getLiteral();
    }
    return BooleanLiteral.create(!(arg0 instanceof AnonymousLiteral || arg0 instanceof URILiteral));
  }
View Full Code Here


    return BooleanLiteral.create(!(arg0 instanceof AnonymousLiteral || arg0 instanceof URILiteral));
  }

  @Builtin(Name = "is-blanknode")
  public static BooleanLiteral is_blanknode(Argument arg) {
    Item arg0 = arg.arguments.get(0);
    if(arg0 instanceof LazyLiteral){
      arg0 = ((LazyLiteral) arg0).getLiteral();
    }
    return BooleanLiteral.create(arg0 instanceof AnonymousLiteral);
  }
View Full Code Here

    return BooleanLiteral.create(arg0 instanceof AnonymousLiteral);
  }

  @Builtin(Name = "is-uri")
  public static BooleanLiteral is_uri(Argument arg) {
    Item arg0 = arg.arguments.get(0);
    if(arg0 instanceof LazyLiteral){
      arg0 = ((LazyLiteral) arg0).getLiteral();
    }
    return BooleanLiteral.create(arg0 instanceof URILiteral);
  }
View Full Code Here

  public Object visit(RuleVariable obj, Object arg) throws RIFException {
    return obj.getVariable();
  }

  protected TriplePattern unitermToTriplePattern(Uniterm obj) {
    Item subject = (Item) obj.termParams.get(0).accept(this, null);
    Item predicate = (Item) obj.termName.accept(this, null);
    Item object = (Item) obj.termParams.get(1).accept(this, null);
    TriplePattern pattern = new TriplePattern(subject, predicate, object);
    return pattern;
  }
View Full Code Here

    } else {
      final URILiteral predName = (URILiteral) pred.termName.accept(this,
          null);
      final List<Item> predItems = new ArrayList<Item>();
      for (final IExpression expr : pred.termParams) {
        final Item item = (Item) expr.accept(this, null);
        predItems.add(item);
      }
      return new PredicatePattern(predName, predItems.toArray(new Item[] {}));
    }
  }
View Full Code Here

      for (final Uniterm term : obj.getHead().getPredicates()) {
        if (!((RulePredicate) term).isTriple()) {
          final URILiteral name = (URILiteral) term.termName.accept(this, arg);
          final List<Item> params = new ArrayList<Item>();
          for (final IExpression expr : term.termParams) {
            final Item item = (Item) expr.accept(this, arg);
            params.add(item);
          }
          final Item[] paramsArray = params.toArray(new Item[] {});
          generate.addPattern(name, paramsArray);
          // Produzenten registrieren
View Full Code Here

    if (!obj.isTriple()) {
      // PredicatePattern erstellen
      final URILiteral predName = (URILiteral) obj.termName.accept(this, arg);
      final List<Item> predItems = new ArrayList<Item>();
      for (final IExpression expr : obj.termParams) {
        final Item item = (Item) expr.accept(this, arg);
        predItems.add(item);
      }
      return new PredicatePattern(predName, predItems.toArray(new Item[] {}));
    }
    return this.unitermToTriplePattern(obj);
View Full Code Here

  protected void insertMultipleURIOperator(Collection<MultipleURIOperator> ops, LinkedList<Tuple<Construct, Item>> graphConstraints, OperatorConnection connection){
    Iterator<MultipleURIOperator> it = ops.iterator();
    for(Tuple<Construct, Item> entry: graphConstraints){
      MultipleURIOperator muo = it.next();
      Collection<URILiteral> cu;
      Item item=entry.getSecond();
      if(item==null){
        cu = new LinkedList<URILiteral>();
      } else if(item.isVariable()){
        cu = this.indexScanCreator.getDataset().getNamedGraphs();
      } else {
        cu = new LinkedList<URILiteral>();
        cu.add((URILiteral)entry.getSecond());
      }
View Full Code Here

  protected void insertMultipleURIOperator(Collection<MultipleURIOperator> ops, LinkedList<Tuple<Construct, Item>> graphConstraints, SimpleNode node){
    Iterator<MultipleURIOperator> it = ops.iterator();
    for(Tuple<Construct, Item> entry: graphConstraints){
      MultipleURIOperator muo = it.next();
      Collection<URILiteral> cu;
      Item item=entry.getSecond();
      if(item==null){
        cu = new LinkedList<URILiteral>();
      } else if(item.isVariable()){
        cu = this.indexScanCreator.getDataset().getNamedGraphs();
      } else {
        cu = new LinkedList<URILiteral>();
        cu.add((URILiteral)entry.getSecond());
      }
View Full Code Here

  @Override
  public void visit(final ASTGraphConstraint node, OperatorConnection connection) {
    final int numberChildren = node.jjtGetNumChildren();

    Item graphConstraint = null;
    final Node child = node.jjtGetChild(0);

    if (child instanceof ASTQuotedURIRef) {
      try {
        graphConstraint = LiteralFactory.createURILiteral(((ASTQuotedURIRef) child).toQueryString());
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.