📄 sesamerepository.java
字号:
/* Sesame - Storage and Querying architecture for RDF and RDF Schema * Copyright (C) 2001-2005 Aduna * * Contact: * Aduna * Prinses Julianaplein 14 b * 3817 CS Amersfoort * The Netherlands * tel. +33 (0)33 465 99 87 * fax. +33 (0)33 465 99 87 * * http://aduna.biz/ * http://www.openrdf.org/ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */package org.openrdf.sesame.repository;import java.io.File;import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStream;import java.io.Reader;import java.net.URL;import org.openrdf.model.Graph;import org.openrdf.model.Resource;import org.openrdf.model.URI;import org.openrdf.model.Value;import org.openrdf.sesame.admin.AdminListener;import org.openrdf.sesame.config.AccessDeniedException;import org.openrdf.sesame.constants.QueryLanguage;import org.openrdf.sesame.constants.RDFFormat;import org.openrdf.sesame.query.GraphQueryResultListener;import org.openrdf.sesame.query.MalformedQueryException;import org.openrdf.sesame.query.QueryEvaluationException;import org.openrdf.sesame.query.QueryResultsTable;import org.openrdf.sesame.query.TableQueryResultListener;/** * Interface for access to a single Sesame repository. This interface * defines a generic entry point for application developers to Sesame * repositories. Implementations of this interface exist that supply * client-server access, as well as local access. * * @author Jeen Broekstra * @author Arjohn Kampman */public interface SesameRepository { /** * Evaluates a query and reports the results as rows in a table to the * supplied listener. * * @param language the query language in which the query is * formulated. * @param query the query. * @param listener the result listener * * @exception IOException In case an I/O error occurs while sending the * query to, or retrieving the result from a Sesame server. * @exception MalformedQueryException If the supplied query is malformed. * @exception QueryEvaluationException If a problem occurs during * evaluation of the query. * @exception AccessDeniedException In case the current user does not have * read access on this repository. * @exception UnsupportedOperationException If this repository does not * support the specified action. * @see QueryLanguage */ public void performTableQuery(QueryLanguage language, String query, TableQueryResultListener listener) throws IOException, MalformedQueryException, QueryEvaluationException, AccessDeniedException; /** * Evaluates a query and returns the results in a * <tt>QueryResultsTable</tt>. * * @param language The query language in which the query is formulated. * @param query The query. * @return A QueryResultsTable object that contains the query result. Note: if * the query returned no results, an empty QueryResultsTable will be returned. * * @exception IOException In case an I/O error occurs while sending the * query to, or retrieving the result from a Sesame server. * @exception MalformedQueryException If the supplied query is malformed. * @exception QueryEvaluationException If a problem occurs during * evaluation of the query. * @exception AccessDeniedException In case the current user does not have * read access on this repository. * @exception UnsupportedOperationException If this repository does not * support the specified action. * @see QueryLanguage */ public QueryResultsTable performTableQuery(QueryLanguage language, String query) throws IOException, MalformedQueryException, QueryEvaluationException, AccessDeniedException; /** * Evaluates a graph query and reports the resulting statements to the * specified listener. * * @param language The query language in which the query is formulated. * Currently, only SeRQL supports graph queries and * <tt>QueryLanguage.SERQL</tt> is the only legal value. * @param query The query. * @param listener A listener for the query result. * * @exception IOException In case an I/O error occurs while sending the * query to, or retrieving the result from a Sesame server. * @exception MalformedQueryException If the supplied query is malformed. * @exception QueryEvaluationException If a problem occurs during * evaluation of the query. * @exception AccessDeniedException In case the current user does not have * read access on this repository. * @exception UnsupportedOperationException If this repository does not * support the specified action. * @see QueryLanguage */ public void performGraphQuery(QueryLanguage language, String query, GraphQueryResultListener listener) throws IOException, MalformedQueryException, QueryEvaluationException, AccessDeniedException; /** * Evaluates a graph query and reports the resulting statements to the * specified listener. * * @param language The query language in which the query is formulated. * Currently, only SeRQL supports graph queries and * <tt>QueryLanguage.SERQL</tt> is the only legal value. * @param query The query. * * @return A Graph object that contains the query result. * * @exception IOException In case an I/O error occurs while sending the * query to, or retrieving the result from a Sesame server. * @exception MalformedQueryException If the supplied query is malformed. * @exception QueryEvaluationException If a problem occurs during * evaluation of the query. * @exception AccessDeniedException In case the current user does not have * read access on this repository. * @exception UnsupportedOperationException If this repository does not * support the specified action. * @see QueryLanguage */ public Graph performGraphQuery(QueryLanguage language, String query) throws IOException, MalformedQueryException, QueryEvaluationException, AccessDeniedException; /** * Adds the RDF data that can be found at the specified URL to the * repository. * * @param dataURL the URL of the RDF data. * @param baseURI the base URI to resolve any relative URIs against. * This defaults to the value of <tt>dataURL</tt> if the value is set * to <tt>null</tt>. * @param format the serialization format of the data (one of * RDFFormat.RDFXML, RDFFormat.NTRIPLES). * @param verifyData if set to 'true', the RDF parser will verify the * data before adding it to the repository. * @param listener an AdminListener that will receive error- and * progress messages. * * @exception IOException In case an I/O error occurs. * @exception AccessDeniedException In case the current user does not have * write access on this repository. * @exception UnsupportedOperationException If this repository does not * support the specified action. * @see RDFFormat */ public void addData(URL dataURL, String baseURI, RDFFormat format, boolean verifyData, AdminListener listener) throws IOException, AccessDeniedException; /** * Adds RDF data from the specified file to the repository. * * @param dataFile a file containing RDF data. * @param baseURI the base URI to resolve any relative URIs against. * @param format the serialization format of the data (one of * RDFFormat.RDFXML, RDFFormat.NTRIPLES). * @param verifyData if set to 'true', the RDF parser will verify the * data before adding it to the repository. * @param listener an AdminListener that will receive error- and * progress messages. * * @exception FileNotFoundException In case the file could not be found. * @exception IOException In case an I/O error occurs. * @exception AccessDeniedException In case the current user does not have * write access on this repository. * @exception UnsupportedOperationException If this repository does not * support the specified action. * @see RDFFormat */ public void addData(File dataFile, String baseURI, RDFFormat format, boolean verifyData, AdminListener listener) throws FileNotFoundException, IOException, AccessDeniedException; /** * Adds an RDF document to the repository. * * @param data an RDF document. * @param baseURI the base URI to resolve any relative URIs against. * @param format the serialization format of the data (one of * RDFFormat.RDFXML, RDFFormat.NTRIPLES). * @param verifyData if set to 'true', the RDF parser will verify the * data before adding it to the repository. * @param listener an AdminListener that will receive error- and * progress messages. * * @exception IOException In case an I/O error occurs. * @exception AccessDeniedException In case the current user does not have * write access on this repository. * @exception UnsupportedOperationException If this repository does not * support the specified action. * @see RDFFormat */ public void addData(String data, String baseURI, RDFFormat format, boolean verifyData, AdminListener listener) throws IOException, AccessDeniedException; /** * Adds the contents of the supplied SesameRepository to this repository. * * @param repository a SesameRepository. * @param listener an AdminListener that will receive error- and * progress messages. * * @exception IOException In case an I/O error occurs. * @exception AccessDeniedException In case the current user does not have
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -