Esempio n. 1
0
  private static QualitativeFeature convertQualitativeFeature(Resource r, String attributeType) {
    QualitativeFeature qf = new QualitativeFeature();
    qf.setType(QUAL_FEATURE.get(attributeType));
    if (r.hasProperty(comment)) qf.setDescription(r.getProperty(comment).getString());
    if (r.hasProperty(name)) qf.setName(r.getProperty(name).getString());

    return qf;
  }
Esempio n. 2
0
  private static ArrayList<QualitativeFeature> convertQualitativeFeatures(Resource r) {
    ArrayList<QualitativeFeature> features = new ArrayList<QualitativeFeature>();

    // a feature can have multiple types
    StmtIterator iter = r.listProperties(type);
    // iterate through types
    while (iter.hasNext()) {
      Resource rType = iter.next().getResource();
      String type = rType.getLocalName();
      if (QUAL_FEATURE.get(type) != null) {
        features.add(convertQualitativeFeature(r, type));
      }
    }

    return features;
  }