Package org.apache.jena.propertytable

Examples of org.apache.jena.propertytable.Row


    ExtendedIterator<Row> iter = null;

    Node s = m.getMatchSubject();

    if ( isConcrete(s) ){
      Row row= pt.getRow(s);
      if (row == null){
        return NullIterator.instance();
      } else {
        ArrayList<Row> rows = new ArrayList<Row>();
        rows.add(row);
View Full Code Here


                return false ;
            }

            while(graphIter.hasNext() && slot == null )
            {
                Row r = graphIter.next() ;
                slot = mapper(r) ;
            }
            if ( slot == null )
                finished = true ;
            return slot != null ;
View Full Code Here

  @Override
  public Row getRow(final Node s) {
    if (s == null)
      throw new NullPointerException("subject node is null");
    Row row = rowIndex.get(s);
    return row;

  }
View Full Code Here

  }
 
  @Override
  public Row createRow(final Node s){
    Row row = this.getRow(s);
    if (row != null)
      return row;

    row = new InternalRow(s);
    rowIndex.put(s, row);
View Full Code Here

    return (rowIndex == null) ? null : new InternalRow(rowIndex);
  }

  @Override
  public Row createRow(Node s) {
    Row row = this.getRow(s);
    if (row != null)
      return row;

    if (rowList.size()>= rowNum)
      throw new IllegalArgumentException("cannot create new row for max row count: " + rowNum);
View Full Code Here

          predicates.add(p);
          table.createColumn(p);
        }
      } else {
        Node subject = LangCSV.caculateSubject(rowNum, csvFilePath);
        Row row = table.createRow(subject);
       
        row.setValue(table.getColumn(CSV_ROW_NODE), NodeFactory.createLiteral(
            (rowNum + ""), XSDDatatype.XSDinteger));

        for (int col = 0; col < rowLine.size() && col<predicates.size(); col++) {

          String columnValue = rowLine.get(col).trim();
          if("".equals(columnValue)){
            continue;
          }
          Node o;
          try {
            // Try for a double.
            double d = Double.parseDouble(columnValue);
            o = NodeFactory.createLiteral(columnValue,
                XSDDatatype.XSDdouble);
          } catch (Exception e) {
            o = NodeFactory.createLiteral(columnValue);
          }
          row.setValue(table.getColumn(predicates.get(col)), o);
        }
      }
      rowNum++;
    }
    return table;
View Full Code Here

    containsValue(1, "a", "e");
    containsValue(1, "b", "f");
  }

  private void nullValue(int rowIndex, String column) {
    Row row = table.getAllRows().get(rowIndex);
    Node v = row.getValue(NodeFactory.createURI(getColumnKey(column)));
    Assert.assertEquals(null, v);
  }
View Full Code Here

    Node v = row.getValue(NodeFactory.createURI(getColumnKey(column)));
    Assert.assertEquals(null, v);
  }

  private void containsValue(int rowIndex, String column, String value) {
    Row row = table.getAllRows().get(rowIndex);
    Node v = row.getValue(NodeFactory.createURI(getColumnKey(column)));
    Assert.assertEquals(value, v.getLiteralValue());
  }
View Full Code Here

TOP

Related Classes of org.apache.jena.propertytable.Row

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.