示例#1
0
文件: Turtle.java 项目: xgfd/SSBLD
  /*
   * Converts the ProductFeature Object into an TriG String
   * representation.
   */
  private String convertProductFeature(ProductFeature pf) {
    StringBuffer result = new StringBuffer();
    // First the uriref for the subject

    result.append(ProductFeature.getPrefixed(pf.getNr()));
    result.append("\n");

    // rdf:type
    result.append(createTriplePO(RDF.prefixed("type"), BSBM.prefixed("ProductFeature")));

    // rdfs:label
    result.append(createTriplePO(RDFS.prefixed("label"), createLiteral(pf.getLabel())));

    // rdfs:comment
    result.append(createTriplePO(RDFS.prefixed("comment"), createLiteral(pf.getComment())));

    // dc:publisher
    result.append(
        createTriplePO(
            DC.prefixed("publisher"),
            createURIref(BSBM.getStandardizationInstitution(pf.getPublisher()))));

    // dc:date
    GregorianCalendar date = new GregorianCalendar();
    date.setTimeInMillis(pf.getPublishDate());
    String dateString = DateGenerator.formatDate(date);
    result.append(
        createTriplePOEnd(
            DC.prefixed("date"), createDataTypeLiteral(dateString, XSD.prefixed("date"))));

    return result.toString();
  }