Exemple #1
0
  /**
   * Returns a string representation of this class
   *
   * @param tabOffset - The offset for all printed lines of this instance
   * @return - A string representation of this class
   */
  @Override
  public String toRdfString(int tabOffset) {
    String construct = "";

    ArrayList<String> lines = new ArrayList<String>();
    String queries;
    if (_queries == null || _queries.length == 0)
      queries =
          RdfPrinter.printTabbedTagWithNoContent(
              tabOffset + 1, RdfGenTypes.RDF_GEN_PREFIX + RdfGenTypes.PROP_RDF_TYPE_QUERIES);
    else
      queries =
          RdfPrinter.printTabbedRdfContainer(
              tabOffset + 1,
              RdfGenTypes.RDF_GEN_PREFIX + RdfGenTypes.PROP_RDF_TYPE_QUERIES,
              "Seq",
              _queries);
    lines.add(queries);
    String attNodeIdMap;
    if (_mapPairs == null || _mapPairs.length == 0)
      attNodeIdMap =
          RdfPrinter.printTabbedTagWithNoContent(
              tabOffset + 1,
              RdfGenTypes.RDF_GEN_PREFIX + RdfGenTypes.PROP_RDF_TYPE_ATT_NODE_ID_MAP);
    else
      attNodeIdMap =
          RdfPrinter.printTabbedRdfContainer(
              tabOffset + 1,
              RdfGenTypes.RDF_GEN_PREFIX + RdfGenTypes.PROP_RDF_TYPE_ATT_NODE_ID_MAP,
              "Bag",
              _mapPairs);
    lines.add(attNodeIdMap);
    String attDynamicVarMapStr = _attDynamicVarMap.toRdfString(tabOffset + 1);
    lines.add(attDynamicVarMapStr);
    ArrayList<String> cPatternLines = new ArrayList<String>();
    cPatternLines.add(_cPattern.toRdfString(tabOffset + 2));
    String creationPattern =
        RdfPrinter.printTabbedComposite(
            tabOffset + 1,
            RdfGenTypes.RDF_GEN_PREFIX + RdfGenTypes.PROP_RDF_TYPE_CREATION_PATTERN,
            cPatternLines);
    lines.add(creationPattern);

    construct +=
        RdfPrinter.printTabbedComposite(
            tabOffset, RdfGenTypes.RDF_GEN_PREFIX + RdfGenTypes.RES_RDF_TYPE_CONSTRUCT, lines);

    return construct;
  }
Exemple #2
0
 /**
  * Returns a string representation of this class
  *
  * @param tabOffset - The offset for all printed lines of this instance
  * @return - A string representation of this class
  */
 @Override
 public String toRdfString(int tabOffset) {
   return RdfPrinter.printTabbedTagWithNoContent(
       tabOffset, RdfGenTypes.RDF_GEN_PREFIX + RdfGenTypes.RES_RDF_TYPE_SELECT_ALL);
 }