Package eu.scape_project.planning.model.measurement

Examples of eu.scape_project.planning.model.measurement.Attribute


        em.refresh(l);
       
        assertEquals(1((Long)em.createQuery("select count(*) from Scale").getSingleResult()).longValue());

        Measure meas = new Measure();
        Attribute attr = new Attribute();
        CriterionCategory cat = new CriterionCategory("test://category/1", "testcategory", EvaluationScope.ALTERNATIVE_ACTION);
        attr.setCategory(cat);
        attr.setName("test attr");
        attr.setUri("test://attribute/1");
        meas.setAttribute(attr);
        meas.setName("test measure");
        meas.setUri("test://measure/1");
       
    }
View Full Code Here


        if (m == null) {
            return hierarchy;
        }

        Attribute a = knownAttributes.get(m.getAttribute().getUri());

        if (a == null) {
            return hierarchy;
        }

        hierarchy.add(0, a.getName());

        CriterionCategory criterionCategory = a.getCategory();

        if (criterionCategory == null) {
            return hierarchy;
        }
View Full Code Here

        ResultSet results = qe.execSelect();

        while ((results != null) && (results.hasNext())) {
            QuerySolution qs = results.next();

            Attribute a = new Attribute();

            a.setDescription(qs.getLiteral("ad").getString());
            a.setName(qs.getLiteral("an").getString());
            a.setUri(qs.getResource("a").toString());
            String categoryUri = qs.getResource("ac").toString();
            a.setCategory(knownCategories.get(categoryUri));

            knownAttributes.put(a.getUri(), a);
        }

    }
View Full Code Here

            if ((s instanceof RestrictedScale) && (qs.contains("r"))) {
                String restriction = qs.getLiteral("r").getString();
                ((RestrictedScale) s).setRestriction(restriction);
            }

            Attribute a = knownAttributes.get(attributeUri);

            m.setAttribute(a);

            if ((a != null) && (s != null)) {
                // only add completely defined measures
View Full Code Here

        measureEl.addAttribute("ID", measure.getUri());
        addStringElement(measureEl, "name", measure.getName());
        addStringElement(measureEl, "description", measure.getDescription());

        Attribute attribute = (Attribute) measure.getAttribute();
        if (attribute != null) {
            Element attributeEl = measureEl.addElement("attribute");
            attributeEl.addAttribute("ID", attribute.getUri());
            addStringElement(attributeEl, "name", attribute.getName());
            addStringElement(attributeEl, "description", attribute.getDescription());

            CriterionCategory category = attribute.getCategory();
            Element categoryEl = attributeEl.addElement("category");
            categoryEl.addAttribute("ID", category.getUri());
            categoryEl.addAttribute("scope", category.getScope().toString());
            addStringElement(categoryEl, "name", category.getName());
        }
View Full Code Here

        Measure m = criteriaManager.getMeasure("http://purl.org/DP/quality/measures#30");
        Assert.assertNotNull(m);
        Assert.assertTrue(StringUtils.isNotEmpty(m.getUri()));
        Assert.assertTrue(StringUtils.isNotEmpty(m.getName()));

        Attribute a = m.getAttribute();
        Assert.assertNotNull(a);
        Assert.assertTrue(StringUtils.isNotEmpty(a.getUri()));
        Assert.assertTrue(StringUtils.isNotEmpty(a.getName()));

        CriterionCategory category = a.getCategory();
        Assert.assertNotNull("Measure '" + m.getName() + "' has no category!", category);
        Assert.assertTrue("Measure '" + m.getName() + "' category has no uri!",
            StringUtils.isNotEmpty(category.getUri()));
        Assert.assertNotNull("Measure '" + m.getName() + "' category " + category.getUri() + " has no scope",
            category.getScope());
View Full Code Here

        for (Measure m : measures) {
            Assert.assertNotNull(m);
            Assert.assertTrue(StringUtils.isNotEmpty(m.getUri()));
            Assert.assertTrue(StringUtils.isNotEmpty(m.getName()));

            Attribute a = m.getAttribute();
            Assert.assertNotNull(a);
            Assert.assertTrue(StringUtils.isNotEmpty(a.getUri()));
            Assert.assertTrue(StringUtils.isNotEmpty(a.getName()));

            CriterionCategory category = a.getCategory();
            Assert.assertNotNull("Measure '" + m.getName() + " has no category defined", category);

            Scale s = m.getScale();
            Assert.assertNotNull("Measure '" + m.getName() + "' has no scale!", s);
            Assert.assertNotNull("Measure '" + m.getName() + "' scale " + s.getDisplayName() + " has no type",
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.measurement.Attribute

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.