Package com.hp.hpl.jena.eyeball.inspectors

Examples of com.hp.hpl.jena.eyeball.inspectors.SparqlDrivenInspector


   
    @Test public void testPrefixInspectorDeclaresPrefixes()
        {
        Report r = new Report();
        Resource root = resourceInModel( "root rdf:type some" );
        SparqlDrivenInspector s = new SparqlDrivenInspector( root );
        s.begin( r, ontModel() );
        List<Property> predicates = r.getPredicateRegister().getRegisteredPredicates();
        assertEquals( eyeResourceSet( "sparqlRequireFailed sparqlProhibitFailed" ), new HashSet<Property>( predicates ) );
        }
View Full Code Here


    @Test public void testReportsSPOViolation()
        {
        Report r = new Report();
        String sparql = "select * where {?s ?p ?o}";
        Resource root = resourceInModel( "root eye:require '<S>'".replaceAll( "<S>", sparql ) );
        SparqlDrivenInspector s = new SparqlDrivenInspector( root );
        s.inspectModel( r, ontModel( "" ) );
        String expect =
            "[eye:mainProperty eye:sparqlRequireFailed & eye:sparqlRequireFailed '<S>']"
            .replaceAll"<S>", sparql )
            ;
        assertIsoModels( itemModel( expect ), r.model() );
View Full Code Here

    @Test public void testReportsSPOViolationWithMessage()
        {
        Report r = new Report();
        String sparql = "select * where {?s ?p ?o}";
        Resource root = resourceInModel( "root eye:sparql [eye:require '<S>' & eye:message 'WHOOPS']".replaceAll( "<S>", sparql ) );
        SparqlDrivenInspector s = new SparqlDrivenInspector( root );
        s.inspectModel( r, ontModel( "" ) );
        String expect = "[eye:mainProperty eye:sparqlRequireFailed & eye:sparqlRequireFailed 'WHOOPS']" ;
        assertIsoModels( itemModel( expect ), r.model() );
        }
View Full Code Here

    @Test public void testAcceptsSPOPresence()
        {
        Report r = new Report();
        String sparql = "select * where {?s ?p ?o}";
        Resource root = resourceInModel( "root eye:require '<S>'".replaceAll( "<S>", sparql ) );
        SparqlDrivenInspector s = new SparqlDrivenInspector( root );
        s.inspectModel( r, ontModel( "my count 17" ) );
        assertIsoModels( itemModel( "" ), r.model() );
        }
View Full Code Here

    @Test public void testRejectsSPOPresence()
        {
        Report r = new Report();
        String sparql = "select * where {?s ?p ?o}";
        Resource root = resourceInModel( "root eye:prohibit '<S>'".replaceAll( "<S>", sparql ) );
        SparqlDrivenInspector s = new SparqlDrivenInspector( root );
        s.inspectModel( r, ontModel( "my count 17" ) );
        String expect =
            "[eye:mainProperty eye:sparqlProhibitFailed & eye:sparqlProhibitFailed '<S>']"
            .replaceAll"<S>", sparql )
            ;
        assertIsoModels( "should report prohibition violation", itemModel( expect ), r.model() );
View Full Code Here

    @Test public void testRejectsSPOPresenceWithMessage()
        {
        Report r = new Report();
        String sparql = "select * where {?s ?p ?o}";
        Resource root = resourceInModel( "root eye:sparql [eye:prohibit '<S>' & eye:message 'SPOO']".replaceAll( "<S>", sparql ) );
        SparqlDrivenInspector s = new SparqlDrivenInspector( root );
        s.inspectModel( r, ontModel( "my count 17" ) );
        String expect =
            "[eye:mainProperty eye:sparqlProhibitFailed & eye:sparqlProhibitFailed 'SPOO']"
            .replaceAll"<S>", sparql )
            ;
        assertIsoModels( "should report prohibition violation", itemModel( expect ), r.model() );
View Full Code Here

    @Test public void testUsesFileInsertion()
        {
        Report r = new Report();
        String sparql = "select * where {?s ?p ?o}";
        Resource root = resourceInModel( "root eye:prohibit '@\"NAME\"'" );
        SparqlDrivenInspector s = new InsertingInspector( root, "NAME", sparql );
        s.inspectModel( r, ontModel( "my count 17" ) );
        String expect =
            "[eye:mainProperty eye:sparqlProhibitFailed & eye:sparqlProhibitFailed '@\"NAME\"']";
        assertIsoModels( "should report prohibition violation", itemModel( expect ), r.model() );       
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.eyeball.inspectors.SparqlDrivenInspector

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.