Package net.fortytwo.flow.rdf

Examples of net.fortytwo.flow.rdf.RDFSink


        final Sink<String> addCommentSink = new NullSink<String>();

        final Sink<String> subtractCommentSink = new NullSink<String>();

        addSink = new RDFSink() {
            public Sink<Statement> statementSink() {
                return addStatementSink;
            }

            public Sink<Namespace> namespaceSink() {
                return addNamespaceSink;
            }

            public Sink<String> commentSink() {
                return addCommentSink;
            }
        };

        subtractSink = new RDFSink() {
            public Sink<Statement> statementSink() {
                return subtractStatementSink;
            }

            public Sink<Namespace> namespaceSink() {
View Full Code Here


        final boolean override = Ripple.getConfiguration().getBoolean(
                Ripple.PREFER_NEWEST_NAMESPACE_DEFINITIONS);
        final boolean allowDuplicateNamespaces = Ripple.getConfiguration().getBoolean(
                Ripple.ALLOW_DUPLICATE_NAMESPACES);

        addSink = new RDFSink() {
            private Sink<Statement> stSink = new Sink<Statement>() {
                public void put(final Statement st) throws RippleException {
//System.out.println( "st = " + st );
                    Resource subj = st.getSubject();
                    URI pred = st.getPredicate();
                    Value obj = st.getObject();

                    synchronized (lexicon) {
                        if (subj instanceof URI) {
                            lexicon.addURI((URI) subj);
                        }

                        lexicon.addURI(pred);

                        if (obj instanceof URI) {
                            lexicon.addURI((URI) obj);
                        }
                    }
                }
            };

            private Sink<Namespace> nsSink = new Sink<Namespace>() {
                public void put(final Namespace ns) throws RippleException {
// TODO: delete me
                }
            };

            private Sink<String> cmtSink = new Sink<String>() {
                public void put(final String comment) throws RippleException {
                }
            };

            public Sink<Statement> statementSink() {
                return stSink;
            }

            public Sink<Namespace> namespaceSink() {
                return nsSink;
            }

            public Sink<String> commentSink() {
                return cmtSink;
            }
        };

// TODO
        subSink = new RDFSink() {
            private Sink<Statement> stSink = new Sink<Statement>() {
                public void put(final Statement st) throws RippleException {
                }
            };
View Full Code Here

                return logStatus(uri, memo);
            }

            memo.setRdfizer(rfiz.getClass().getName());

            RDFSink adder = dataStore.createInputSink(sc);
            RDFBuffer buffer = new RDFBuffer(adder);

            // Note: any context information in the source document is discarded.
            RDFSink pipe = new SingleContextPipe(buffer, valueFactory.createURI(graphUri), valueFactory);

            RDFHandler handler = new SesameInputAdapter(useBlankNodes
                    ? pipe
                    : new BNodeToURIFilter(pipe, valueFactory));
View Full Code Here

        SailConnection sc = sail.getConnection();
        try {
            sc.begin();
            SailInserter inserter = new SailInserter(sc);
            SesameOutputAdapter outAdapter = new SesameOutputAdapter(inserter);
            RDFSink scp = new SingleContextPipe(outAdapter, context, sail.getValueFactory());
            SesameInputAdapter inAdapter = new SesameInputAdapter(scp);
            parser.setRDFHandler(inAdapter);

            inserter.startRDF();
View Full Code Here

            public void put(final String comment) throws RippleException {
                contextToCollectorMap.get(null).subtractorSink().commentSink().put(comment);
            }
        };

        addSink = new RDFSink() {
            public Sink<Statement> statementSink() {
                return stAddSink;
            }

            public Sink<Namespace> namespaceSink() {
                return nsAddSink;
            }

            public Sink<String> commentSink() {
                return cmtAddSink;
            }
        };

        subSink = new RDFSink() {
            public Sink<Statement> statementSink() {
                return stSubSink;
            }

            public Sink<Namespace> namespaceSink() {
View Full Code Here

TOP

Related Classes of net.fortytwo.flow.rdf.RDFSink

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.