001    /*
002     * (c) Copyright 2009 University of Bristol
003     * All rights reserved.
004     * [See end of file]
005     */
006    
007    package net.rootdev.javardfa;
008    
009    /**
010     * @author Damian Steer <pldms@mac.com>
011     */
012    
013    public interface StatementSink
014    {
015        /**
016         *
017         */
018        public void setBase(String base);
019    
020        /**
021         * Begin parsing
022         */
023        public void start();
024    
025        /**
026         * Complete parsing
027         */
028        public void end();
029    
030        /**
031         * Add statement with non-literal object.
032         * Blank nodes begin with _:, variables with ?, otherwise IRI
033         * @param subject Subject of triple
034         * @param predicate Predicate
035         * @param object Object
036         */
037        public void addObject(String subject, String predicate, String object);
038    
039        /**
040         * Add statement with a literal object.
041         * As above, blank nodes begin with _:, variables with ?, otherwise IRI
042         * @param subject Subject of triple
043         * @param predicate Predicate
044         * @param lex Lexical form
045         * @param lang Language (may be null)
046         * @param datatype Datatype IRI (may be null)
047         */
048        public void addLiteral(String subject, String predicate, String lex, String lang, String datatype);
049    
050        /**
051         * Add a prefix mapping.
052         * @param prefix
053         * @param uri
054         */
055        public void addPrefix(String prefix, String uri);
056    }
057    
058    /*
059     * (c) Copyright 2009 University of Bristol
060     * All rights reserved.
061     *
062     * Redistribution and use in source and binary forms, with or without
063     * modification, are permitted provided that the following conditions
064     * are met:
065     * 1. Redistributions of source code must retain the above copyright
066     *    notice, this list of conditions and the following disclaimer.
067     * 2. Redistributions in binary form must reproduce the above copyright
068     *    notice, this list of conditions and the following disclaimer in the
069     *    documentation and/or other materials provided with the distribution.
070     * 3. The name of the author may not be used to endorse or promote products
071     *    derived from this software without specific prior written permission.
072     *
073     * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
074     * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
075     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
076     * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
077     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
078     * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
079     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
080     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
081     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
082     * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
083     */