Package org.fcrepo.server.validation

Examples of org.fcrepo.server.validation.RelsValidator

  • For RELS-EXT, there must be only ONE <rdf:Description> element.
  • There must be NO nesting of assertions. In terms of XML depth, the RDF root element is considered depth of 0. Then, the <rdf:Description> element must be at depth of 1, and the relationship properties must exist at depth of 2. That's it.
  • For RELS-EXT, The RDF about attribute of the RDF <Description> must be the URI of the digital object in which the RELS-EXT datastream resides. This means that all relationships are FROM "this" object to other objects.
  • For RELS-INT, the RDF about attribute(s) of the RDF <Description> element(s) must be valid URIs of datastreams for the digital object in which the RELS-EXT datastream resides. The datastreams do not actually have to exist, but these URIs must be syntactically valid. This means that all relationships are FROM datastreams in "this" object to other objects.
  • If the target of the statement is a resource (identified by a URI), the RDF resource attribute must specify a syntactically valid, absolute URI.
  • For RELS-EXT, there must NOT be any assertion of properties from the DC namespace.
  • There must NOT be any assertions of properties from the Fedora object properties namespaces (model and view), with the following exceptions for RELS-EXT only:
     fedora-model:hasService fedora-model:hasModel fedora-model:isDeploymentOf fedora-model:isContractorOf These assertions are allowed in the RELS-EXT datastream, but all others from the fedora-model and fedora-view namespaces are inferred from values expressed elsewhere in the digital object, and we do not want duplication. 
  • @author Sandy Payette @author Eddie Shin @author Chris Wilper @author Stephen Bayliss

        }

        public void testValidateValidRelsExt() throws Exception {
            pid = PID.getInstance("demo:888");
            InputStream in = new ByteArrayInputStream(RELS_EXT);
            RelsValidator validator = new RelsValidator();
            validator.validate(pid, "RELS-EXT", in);
        }
    View Full Code Here


            validator.validate(pid, "RELS-EXT", in);
        }
        public void testValidateValidRelsInt() throws Exception {
            pid = PID.getInstance("demo:888");
            InputStream in = new ByteArrayInputStream(RELS_INT);
            RelsValidator validator = new RelsValidator();
            validator.validate(pid, "RELS-INT", in);
        }
    View Full Code Here

        }
        public void testValidateInvalidRelsExt() throws Exception {
            pid = PID.getInstance("demo:888");
            // use RELS-INT sample as a RELS-EXT datastream
            InputStream in = new ByteArrayInputStream(RELS_INT);
            RelsValidator validator = new RelsValidator();
            try {
                validator.validate(pid, "RELS-EXT", in);
                fail("Multiple Description elements not allowed for RELS-EXT");
            } catch (ValidationException e) {}
        }
    View Full Code Here

            for (String s : empties) {
                in = new ByteArrayInputStream(s.getBytes());

                try {
                    new RelsValidator().validate(pid, dsId, in);
                    fail("Empty " + dsId + " datastream incorrectly passed"
                         + " validation: \"" + s + "\"");
                } catch (ValidationException e) {}
            }
        }
    View Full Code Here

        private void validateAndClear(String dsId) throws Exception {
            try {
                TripleIterator iter = new MockTripleIterator(triples);
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                iter.toStream(out, RDFFormat.RDF_XML, false);
                new RelsValidator().validate(pid, dsId, new ByteArrayInputStream(out.toByteArray()));
            } finally {
                triples.clear();
            }
        }
    View Full Code Here

    TOP

    Related Classes of org.fcrepo.server.validation.RelsValidator

    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.