Examples of Quad


Examples of com.ardor3d.scenegraph.shape.Quad

        // setting to default value just to show
        this.waterHeight = waterHeight;
        setWaterPlane(new Plane(new Vector3(0.0, 1.0, 0.0), waterHeight));

        // Create a quad to use as geometry for the water.
        waterQuad = new Quad("waterQuad", 1, 1);
        // Hack the quad normals to point up in the y-axis. Since we are manipulating the vertices as
        // we move this is more convenient than rotating the quad.
        final FloatBuffer normBuf = waterQuad.getMeshData().getNormalBuffer();
        normBuf.clear();
        normBuf.put(0).put(1).put(0);
View Full Code Here

Examples of com.github.jsonldjava.core.RDFDataset.Quad

        };
        final List<RDFDataset.Quad> unmatched = new ArrayList<RDFDataset.Quad>();
        final BnodeMappings bnodeMaps = new BnodeMappings();
        boolean finalpass = false;
        while (!exp.isEmpty() && !res.isEmpty()) {
            final Quad eq = exp.remove(0);
            int matches = 0;
            RDFDataset.Quad last_match = null;
            for (final RDFDataset.Quad rq : res) {
                // if predicates are not equal there cannot be a match
                if (!eq.getPredicate().equals(rq.getPredicate())) {
                    continue;
                }
                if (eq.getSubject().isBlankNode() && rq.getSubject().isBlankNode()) {
                    // check for locking
                    boolean subjectLocked = false;
                    if (bnodeMaps.isLocked(eq.getSubject().getValue())) {
                        // if this mapping doesn't match the locked mapping, we
                        // don't have a match
                        if (!rq.getSubject().getValue()
                                .equals(bnodeMaps.getMapping(eq.getSubject().getValue()))) {
                            continue;
                        }
                        subjectLocked = true;
                    }
                    // if the objects are also both blank nodes
                    if (eq.getObject().isBlankNode() && rq.getObject().isBlankNode()) {
                        // check for locking
                        if (bnodeMaps.isLocked(eq.getObject().getValue())) {
                            // if this mapping doesn't match the locked mapping,
                            // we don't have a match
                            if (!rq.getObject().getValue()
                                    .equals(bnodeMaps.getMapping(eq.getObject().getValue()))) {
                                continue;
                            }
                        } else {
                            // add possible mappings for the objects
                            bnodeMaps.addPossibleMapping(eq.getObject().getValue(), rq.getObject()
                                    .getValue());
                        }
                    }
                    // otherwise, if the objects aren't equal we can't have a
                    // match
                    else if (!eq.getObject().equals(rq.getObject())) {
                        continue;
                    }
                    // objects are equal or both blank nodes so we have a match
                    matches++;
                    last_match = rq;
                    // if subject is not locked add a possible mapping between
                    // subjects
                    if (!subjectLocked) {
                        bnodeMaps.addPossibleMapping(eq.getSubject().getValue(), rq.getSubject()
                                .getValue());
                    }
                }
                // otherwise check if the subjects are equal
                else if (eq.getSubject().equals(rq.getSubject())) {
                    // if both objects are blank nodes, add possible mappings
                    // for them
                    if (eq.getObject().isBlankNode() && rq.getObject().isBlankNode()) {
                        // check for locking
                        if (bnodeMaps.isLocked(eq.getObject().getValue())) {
                            // if this mapping doesn't match the locked mapping,
                            // we don't have a match
                            if (!rq.getObject().getValue()
                                    .equals(bnodeMaps.getMapping(eq.getObject().getValue()))) {
                                continue;
                            }
                        } else {
                            // add possible mappings for the objects
                            bnodeMaps.addPossibleMapping(eq.getObject().getValue(), rq.getObject()
                                    .getValue());
                        }
                        // if we get here we have a match
                        matches++;
                        last_match = rq;
                    }
                    // otherwise, if the objects are equal we we have an exact
                    // match
                    else if (eq.getObject().equals(rq.getObject())) {
                        matches = 1;
                        last_match = rq;
                        break;
                    }
                }
            }

            if (matches == 0) {
                // if we didn't find any matches, we're done and things didn't
                // match!
                return false;
            } else if (matches == 1) {
                // we have one match
                if (eq.getSubject().isBlankNode()) {
                    // lock this mapping
                    bnodeMaps.lockMapping(eq.getSubject().getValue(), last_match.getSubject()
                            .getValue());
                }
                if (eq.getObject().isBlankNode()) {
                    // lock this mapping
                    bnodeMaps.lockMapping(eq.getObject().getValue(), last_match.getObject()
                            .getValue());
                }
                res.remove(last_match);
            } else {
                // we got multiple matches, we need to figure this stuff out
View Full Code Here

Examples of com.hp.hpl.jena.sparql.core.Quad

    /** Example setup - in-memory dataset with two graphs, one triple in each */
    private static Dataset setup()
    {
        Dataset ds = TDBFactory.createDataset() ;
        DatasetGraphTDB dsg = (DatasetGraphTDB)(ds.asDatasetGraph()) ;
        Quad q1 = SSE.parseQuad("(<http://example/g1> <http://example/s> <http://example/p> <http://example/o1>)") ;
        Quad q2 = SSE.parseQuad("(<http://example/g2> <http://example/s> <http://example/p> <http://example/o2>)") ;
        dsg.add(q1) ;
        dsg.add(q2) ;
        return ds ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.core.Quad

    {
        Node gNode = nodeTable.getNodeForNodeId(g) ;
        Node sNode = nodeTable.getNodeForNodeId(s) ;
        Node pNode = nodeTable.getNodeForNodeId(p) ;
        Node oNode = nodeTable.getNodeForNodeId(o) ;
        return new Quad(gNode, sNode, pNode, oNode) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.core.Quad

    public boolean equivalent(OpQuadPattern opQuads)
    {
        QuadPattern quads = opQuads.getPattern() ;
        if ( quads.size() != 1 ) return false ;
        Quad q = quads.get(0) ;
        return quad.equals(q)
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.core.Quad

    {
        if ( quads == null )
        {
            quads = new QuadPattern() ;
            for (Triple t : triples )
                quads.add(new Quad(graphNode, t)) ;
        }
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.core.Quad

    @Test public void testInsert3()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        gStore.addGraph(graphIRI, Factory.createDefaultGraph()) ;
        UpdateModify insert = new UpdateModify() ;
        insert.getInsertAcc().addQuad(new Quad(graphIRI, triple1)) ;
        UpdateAction.execute(insert, gStore) ;
        assertTrue(graphContains(gStore.getGraph(graphIRI), triple1)) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.core.Quad

        namedGraphData(gStore, graphIRI, Factory.createDefaultGraph()) ;
       
        UpdateModify modify = new UpdateModify() ;
        Element element = QueryFactory.createElement("{ ?s <http://example/p> ?o }" ) ;
        modify.setElement(element) ;
        modify.getInsertAcc().addQuad(new Quad(graphIRI, triple1)) ;
        modify.getDeleteAcc().addTriple(SSE.parseTriple("(?s <http://example/p> ?o)")) ;
        modify.getDeleteAcc().addQuad(SSE.parseQuad("(<http://example/graph> ?s <http://example/p> ?o)")) ;
        UpdateAction.execute(modify, gStore) ;
       
        assertFalse(graphEmpty(gStore.getGraph(graphIRI))) ;
View Full Code Here

Examples of com.hp.hpl.jena.sparql.core.Quad

        namedGraphData(gStore, graphIRI, data(t));
       
        UpdateModify modify = new UpdateModify() ;
        Element element = QueryFactory.createElement("{ ?s <http://example/p> ?o }" ) ;
        modify.setElement(element) ;
        modify.getInsertAcc().addQuad(new Quad(graphIRI, triple1)) ;
        modify.getDeleteAcc().addTriple(SSE.parseTriple("(?s <http://example/p> ?o)")) ;
        modify.getDeleteAcc().addQuad(SSE.parseQuad("(<http://example/graph> ?s <http://example/p> ?o)")) ;
        UpdateAction.execute(modify, gStore) ;
       
        assertFalse(graphEmpty(gStore.getGraph(graphIRI))) ;
View Full Code Here

Examples of com.hp.hpl.jena.sparql.core.Quad

        // WRITE lots
        StoreConnection sConn = getStoreConnection() ;
        DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE) ;
        for ( int i = 0 ; i < 600 ; i++ )
        {
            Quad q = SSE.parseQuad("(_ <s> <p> "+i+")") ;
            dsg.add(q) ;
        }
        dsg.commit() ;
        dsg.end() ;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.