Soprano 2.6.0
|
00001 /* This file is part of Soprano 00002 * 00003 * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com> 00004 * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef _SOPRANO_TYPES_H_ 00023 #define _SOPRANO_TYPES_H_ 00024 00025 #include "soprano_export.h" 00026 00027 #include <QtCore/QFlags> 00028 #include <QtCore/QString> 00029 00030 namespace Soprano 00031 { 00037 // FIXME: what about the used charsets? Should we and if so, how should we include them? 00038 // FIXME: SerializationUnknown and SerializationUser should become the same, i.e. one should become deprecated 00039 enum RdfSerialization { 00040 SerializationUnknown = 0x0, 00041 SerializationRdfXml = 0x1, 00042 SerializationN3 = 0x2, 00043 SerializationNTriples = 0x4, 00044 SerializationTurtle = 0x8, 00045 SerializationTrig = 0x10, 00046 SerializationNQuads = 0x20, 00047 SerializationUser = 0x0 00048 }; 00049 Q_DECLARE_FLAGS(RdfSerializations, RdfSerialization) 00050 00051 00061 SOPRANO_EXPORT QString serializationMimeType( RdfSerialization serialization, const QString& userSerialization = QString() ); 00062 00069 SOPRANO_EXPORT RdfSerialization mimeTypeToSerialization( const QString& mimetype ); 00070 00077 enum BackendOption { 00078 BackendOptionNone = 0x0, 00079 BackendOptionStorageMemory = 0x1, 00080 BackendOptionEnableInference = 0x2, 00081 BackendOptionStorageDir = 0x4, 00082 BackendOptionHost = 0x8, 00083 BackendOptionPort = 0x10, 00084 BackendOptionUsername = 0x20, 00085 BackendOptionPassword = 0x40, 00086 BackendOptionUser = 0x1000 00087 }; 00088 Q_DECLARE_FLAGS( BackendOptions, BackendOption ) 00089 00090 00098 enum BackendFeature { 00099 BackendFeatureNone = 0x0, 00100 BackendFeatureAddStatement = 0x1, 00101 BackendFeatureRemoveStatements = 0x2, 00102 BackendFeatureListStatements = 0x4, 00103 BackendFeatureQuery = 0x8, 00104 BackendFeatureInference = 0x10, 00105 BackendFeatureInferenceOptional = 0x20, 00106 BackendFeatureContext = 0x40, 00107 BackendFeatureStorageMemory = 0x80, 00108 BackendFeatureAll = BackendFeatureAddStatement| 00109 BackendFeatureRemoveStatements| 00110 BackendFeatureListStatements| 00111 BackendFeatureQuery| 00112 BackendFeatureInference| 00113 BackendFeatureInferenceOptional| 00114 BackendFeatureContext| 00115 BackendFeatureStorageMemory, 00116 BackendFeatureUser = 0x1000 00117 }; 00118 Q_DECLARE_FLAGS( BackendFeatures, BackendFeature ) 00119 00120 00121 namespace Query { 00129 enum QueryLanguage { 00130 QueryLanguageNone = 0x0, 00131 QueryLanguageSparql = 0x1, 00132 QueryLanguageRdql = 0x2, 00133 QueryLanguageSerql = 0x4, 00134 QueryLanguageUser = 0x1000, 00135 QUERY_LANGUAGE_NONE = QueryLanguageNone, 00136 QUERY_LANGUAGE_SPARQL = QueryLanguageSparql, 00137 QUERY_LANGUAGE_RDQL = QueryLanguageRdql, 00138 QUERY_LANGUAGE_SERQL = QueryLanguageSerql, 00139 QUERY_LANGUAGE_USER = QueryLanguageUser 00140 }; 00141 Q_DECLARE_FLAGS( QueryLanguages, QueryLanguage ) 00142 00143 00153 SOPRANO_EXPORT QString queryLanguageToString( Soprano::Query::QueryLanguage lang, const QString& userQueryLanguage = QString() ); 00154 00162 SOPRANO_EXPORT QueryLanguage queryLanguageFromString( const QString& queryLanguage ); 00163 } 00164 } 00165 00166 Q_DECLARE_OPERATORS_FOR_FLAGS(Soprano::RdfSerializations) 00167 Q_DECLARE_OPERATORS_FOR_FLAGS(Soprano::BackendOptions) 00168 Q_DECLARE_OPERATORS_FOR_FLAGS(Soprano::BackendFeatures) 00169 Q_DECLARE_OPERATORS_FOR_FLAGS(Soprano::Query::QueryLanguages) 00170 00171 #endif