Package eu.planets_project.services.datatypes

Examples of eu.planets_project.services.datatypes.Property


            String suffix = split[split.length - 1];
            if (extensions.contains(suffix.toLowerCase())) {
                /* For that, get the extractable properties: */
                List<String> listProperties = listProperties(metadataType);
                for (String string : listProperties) {
                    result.add(new Property(makePropertyURI(string), string, null));
                }
            }
        }
        return result;
    }
View Full Code Here


        try {
            Document doc = builder.build(new StringReader(metadataXml));
            Element meta = doc.getRootElement().getChild("METADATA");
            for (Object propElem : meta.getChildren()) {
                Element e = (Element) propElem;
                Property p = new Property(makePropertyURI(e.getName()), e.getName(), e.getText());
                properties.add(p);
            }

        } catch (JDOMException e) {
            e.printStackTrace();
View Full Code Here

        List<Property> properties = characteriseResult.getProperties();
        System.out.println("Characterised " + file.getAbsolutePath() + " as: "
                + properties);
        Assert.assertTrue("Result does not contain the correct mime type: "
                + type.mime + " in result: " + properties, properties
                .contains(new Property(MetadataExtractor.makePropertyURI("TYPE"), "TYPE", type.mime)));
    }
View Full Code Here

     * @return string representation of the evaluation result
     */
    @Deprecated
    public String getEvaluationResult(String propertyName, String metricName) {
        if (pservProperties != null) {
            Property p = lookUpPservProperty(propertyName);
            if (p != null) {
                // eu.planets_project.ifr.core.services.comparison.comparator.impl.ResultPropertiesReader:
                // descriptionBuilder.append(String.format(" %s=%s", metricName, resultString));
                String descr = p.getDescription().replaceAll(" ", "]").replaceAll("\\[", "]");
                String metricKey = "]"+metricName+"=";
                int startIdx = descr.indexOf(metricKey);
                if (startIdx >-1) {
                    startIdx += metricKey.length();
                }
View Full Code Here

        }
        //iterate over the properties and truncate when more than 500 chars
        for(Property p : cr.getProperties()){
          if(p.getValue().length()>500){
            //add a truncated value String
            ret.add(new Property(p.getUri(),p.getName(),p.getValue().substring(0, 500)+"[..]"));
          }else{
            //add the original result
            ret.add(p);
          }
        }
View Full Code Here

  private Event buildMigrationOutputEvent(DigitalObject migrInput,
      List<Parameter> migrParameters, long startTime, long duration,
      ServiceDescription serDescr, String serEndpoint) {

    List<Property> propList = new ArrayList<Property>();
    Property pMigrDuration = new Property.Builder(URI
        .create("planets://service/migration/performance/duration"))
        .name("duration of migration")
        .value(duration + "")
        .description(
            "Measurement of the Migration.Action taken on the batch processor's end")
        .unit("time in millis").type("service characteristic").build();
    Property pSerParams = new Property.Builder(URI
        .create("planets://service/migration/configuration"))
        .name("service configuration")
        .value(migrParameters.toString())
        .description(
            "Record of the specific parameter configuration that were applied")
        .type("service characteristic").build();
    Property pOldContentLink = new Property.Builder(URI
        .create("planets://data/predecessor"))
        .name("prececessor reference")
        .value(migrInput.getPermanentUri() + "")
        .description(
            "A reference to the predecessor object the migration result was derived from.")
        .type("directional pointer").build();
   
    if(serDescr!=null && serEndpoint!=null){
      Property serDesc = new Property.Builder(URI
          .create("planets://service/migration/description"))
          .name("service description")
          .value("endpoint: "+serEndpoint+" service description: "+serDescr.toString())
          .description(
              "Information about the tool and the service that has been called")
View Full Code Here

TOP

Related Classes of eu.planets_project.services.datatypes.Property

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.