<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Soprano: /builddir/build/BUILD/soprano-2.5.2/soprano/node.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <script type="text/javascript"> function hasClass(ele,cls) { return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); } function addClass(ele,cls) { if (!this.hasClass(ele,cls)) ele.className += " "+cls; } function removeClass(ele,cls) { if (hasClass(ele,cls)) { var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)'); ele.className=ele.className.replace(reg,' '); } } function toggleVisibility(linkObj) { var base = linkObj.getAttribute('id'); var summary = document.getElementById(base + '-summary'); var content = document.getElementById(base + '-content'); var trigger = document.getElementById(base + '-trigger'); if ( hasClass(linkObj,'closed') ) { summary.style.display = 'none'; content.style.display = 'block'; trigger.src = 'open.png'; removeClass(linkObj,'closed'); addClass(linkObj,'opened'); } else if ( hasClass(linkObj,'opened') ) { summary.style.display = 'block'; content.style.display = 'none'; trigger.src = 'closed.png'; removeClass(linkObj,'opened'); addClass(linkObj,'closed'); } return false; } </script> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <h1>/builddir/build/BUILD/soprano-2.5.2/soprano/node.h</h1> </div> </div> <div class="contents"> <a href="node_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * This file is part of Soprano Project.</span> <a name="l00003"></a>00003 <span class="comment"> *</span> <a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2006-2007 Daniele Galdi <daniele.galdi@gmail.com></span> <a name="l00005"></a>00005 <span class="comment"> * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org></span> <a name="l00006"></a>00006 <span class="comment"> *</span> <a name="l00007"></a>00007 <span class="comment"> * This library is free software; you can redistribute it and/or</span> <a name="l00008"></a>00008 <span class="comment"> * modify it under the terms of the GNU Library General Public</span> <a name="l00009"></a>00009 <span class="comment"> * License as published by the Free Software Foundation; either</span> <a name="l00010"></a>00010 <span class="comment"> * version 2 of the License, or (at your option) any later version.</span> <a name="l00011"></a>00011 <span class="comment"> *</span> <a name="l00012"></a>00012 <span class="comment"> * This library is distributed in the hope that it will be useful,</span> <a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00015"></a>00015 <span class="comment"> * Library General Public License for more details.</span> <a name="l00016"></a>00016 <span class="comment"> *</span> <a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU Library General Public License</span> <a name="l00018"></a>00018 <span class="comment"> * along with this library; see the file COPYING.LIB. If not, write to</span> <a name="l00019"></a>00019 <span class="comment"> * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,</span> <a name="l00020"></a>00020 <span class="comment"> * Boston, MA 02110-1301, USA.</span> <a name="l00021"></a>00021 <span class="comment"> */</span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="preprocessor">#ifndef SOPRANO_NODE_H</span> <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define SOPRANO_NODE_H</span> <a name="l00025"></a>00025 <span class="preprocessor"></span> <a name="l00026"></a>00026 <span class="preprocessor">#include <QtCore/QUrl></span> <a name="l00027"></a>00027 <span class="preprocessor">#include <QtCore/QSharedDataPointer></span> <a name="l00028"></a>00028 <span class="preprocessor">#include <QtCore/QTextStream></span> <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="soprano__export_8h.html">soprano_export.h</a>"</span> <a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="literalvalue_8h.html">literalvalue.h</a>"</span> <a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="languagetag_8h.html">languagetag.h</a>"</span> <a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="sopranomacros_8h.html">sopranomacros.h</a>"</span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="keyword">namespace </span>Soprano <a name="l00036"></a>00036 { <a name="l00053"></a><a class="code" href="classSoprano_1_1Node.html">00053</a> <span class="keyword">class </span><a class="code" href="soprano__export_8h.html#a4f040b77f4fdd45fda0c3d6ced1e3776">SOPRANO_EXPORT</a> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> <a name="l00054"></a>00054 { <a name="l00055"></a>00055 <span class="keyword">public</span>: <a name="l00056"></a><a class="code" href="classSoprano_1_1Node.html#ac63f6890978f00f3da8da427f4c5d16c">00056</a> <span class="keyword">enum</span> <a class="code" href="classSoprano_1_1Node.html#ac63f6890978f00f3da8da427f4c5d16c">Type</a> { <a name="l00057"></a><a class="code" href="classSoprano_1_1Node.html#ac63f6890978f00f3da8da427f4c5d16ca51684f72e7ddec35773baa2d732a4c42">00057</a> EmptyNode = 0, <a name="l00058"></a><a class="code" href="classSoprano_1_1Node.html#ac63f6890978f00f3da8da427f4c5d16ca757bb91571717c2d447da4b66ba63283">00058</a> ResourceNode = 1, <a name="l00059"></a><a class="code" href="classSoprano_1_1Node.html#ac63f6890978f00f3da8da427f4c5d16ca59d7743a9f37cdd4c84df3b4076371e8">00059</a> LiteralNode = 2, <a name="l00060"></a><a class="code" href="classSoprano_1_1Node.html#ac63f6890978f00f3da8da427f4c5d16caf093a8a3ad76f0b25ede1c9971990827">00060</a> BlankNode = 3 <a name="l00061"></a>00061 }; <a name="l00062"></a>00062 <a name="l00073"></a>00073 <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>(); <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="comment">// This constructor is non-explicit for a reason: it makes creating</span> <a name="l00076"></a>00076 <span class="comment">// Statements much much easier and more readable</span> <a name="l00085"></a>00085 <span class="comment"></span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>( <span class="keyword">const</span> <a class="codeRef" href="qurl.html">QUrl</a> &uri ); <a name="l00086"></a>00086 <a name="l00094"></a>00094 <span class="keyword">explicit</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>& <span class="keywordtype">id</span> ); <a name="l00095"></a>00095 <a name="l00106"></a>00106 <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">LiteralValue</a>& <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1RDF.html#a0e57b07dcc5317ad7925ebdb466528c0">value</a> ); <a name="l00107"></a>00107 <a name="l00120"></a>00120 <a class="code" href="sopranomacros_8h.html#a1222da7bc3bd6ea5b6308782b7aa8cb5">SOPRANO_CONSTRUCTOR_DEPRECATED</a> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">LiteralValue</a>& <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1RDF.html#a0e57b07dcc5317ad7925ebdb466528c0">value</a>, <a name="l00121"></a>00121 <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>& <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1Xesam.html#a24eb968dfba3510cc343904910f0059d">language</a> ); <a name="l00122"></a>00122 <a name="l00126"></a>00126 <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> &other ); <a name="l00127"></a>00127 <a name="l00128"></a>00128 ~<a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>(); <a name="l00130"></a>00130 <a name="l00135"></a>00135 <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& operator=( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& other ); <a name="l00136"></a>00136 <a name="l00140"></a>00140 <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& operator=( <span class="keyword">const</span> <a class="codeRef" href="qurl.html">QUrl</a>& resource ); <a name="l00141"></a>00141 <a name="l00145"></a>00145 <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& operator=( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">LiteralValue</a>& literal ); <a name="l00146"></a>00146 <a name="l00151"></a>00151 <span class="keywordtype">bool</span> operator==( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& other ) <span class="keyword">const</span>; <a name="l00152"></a>00152 <a name="l00157"></a>00157 <span class="keywordtype">bool</span> operator!=( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& other ) <span class="keyword">const</span>; <a name="l00158"></a>00158 <a name="l00164"></a>00164 <span class="keywordtype">bool</span> operator==( <span class="keyword">const</span> <a class="codeRef" href="qurl.html">QUrl</a>& uri ) <span class="keyword">const</span>; <a name="l00165"></a>00165 <a name="l00171"></a>00171 <span class="keywordtype">bool</span> operator==( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">LiteralValue</a>& other ) <span class="keyword">const</span>; <a name="l00172"></a>00172 <a name="l00190"></a>00190 <span class="keywordtype">bool</span> matches( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& other ) <span class="keyword">const</span>; <a name="l00192"></a>00192 <a name="l00200"></a>00200 Type <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1RDF.html#a28ec91b268156971dedc36c027a023a6">type</a>() <span class="keyword">const</span>; <a name="l00201"></a>00201 <a name="l00205"></a>00205 <span class="keywordtype">bool</span> isEmpty() <span class="keyword">const</span>; <a name="l00206"></a>00206 <a name="l00210"></a>00210 <span class="keywordtype">bool</span> isValid() <span class="keyword">const</span> ; <a name="l00211"></a>00211 <a name="l00215"></a>00215 <span class="keywordtype">bool</span> isLiteral() <span class="keyword">const</span>; <a name="l00216"></a>00216 <a name="l00220"></a>00220 <span class="keywordtype">bool</span> isResource() <span class="keyword">const</span>; <a name="l00221"></a>00221 <a name="l00225"></a>00225 <span class="keywordtype">bool</span> isBlank() <span class="keyword">const</span>; <a name="l00227"></a>00227 <a name="l00236"></a>00236 <a class="codeRef" href="qurl.html">QUrl</a> uri() <span class="keyword">const</span>; <a name="l00238"></a>00238 <a name="l00248"></a>00248 <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1NAO.html#a17fbc8e1e181057f8e102967c31316ae">identifier</a>() <span class="keyword">const</span>; <a name="l00250"></a>00250 <a name="l00259"></a>00259 <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">LiteralValue</a> literal() <span class="keyword">const</span>; <a name="l00260"></a>00260 <a name="l00266"></a>00266 <a class="codeRef" href="qurl.html">QUrl</a> dataType() <span class="keyword">const</span>; <a name="l00267"></a>00267 <a name="l00279"></a>00279 <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1Xesam.html#a24eb968dfba3510cc343904910f0059d">language</a>() <span class="keyword">const</span>; <a name="l00281"></a>00281 <a name="l00294"></a>00294 <a class="codeRef" href="qstring.html">QString</a> toString() <span class="keyword">const</span>; <a name="l00295"></a>00295 <a name="l00314"></a>00314 <a class="codeRef" href="qstring.html">QString</a> toN3() <span class="keyword">const</span>; <a name="l00316"></a>00316 <a name="l00324"></a>00324 <span class="keyword">static</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> createEmptyNode(); <a name="l00325"></a>00325 <a name="l00336"></a>00336 <span class="keyword">static</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> createResourceNode( <span class="keyword">const</span> <a class="codeRef" href="qurl.html">QUrl</a>& uri ); <a name="l00337"></a>00337 <a name="l00352"></a>00352 <span class="keyword">static</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> createBlankNode( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>& <span class="keywordtype">id</span> ); <a name="l00353"></a>00353 <a name="l00367"></a>00367 <span class="keyword">static</span> <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> createLiteralNode( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">LiteralValue</a>& <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1RDF.html#a0e57b07dcc5317ad7925ebdb466528c0">value</a> ); <a name="l00368"></a>00368 <a name="l00384"></a>00384 <span class="keyword">static</span> SOPRANO_DEPRECATED <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> createLiteralNode( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">LiteralValue</a>& <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1RDF.html#a0e57b07dcc5317ad7925ebdb466528c0">value</a>, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>& <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1Xesam.html#a24eb968dfba3510cc343904910f0059d">language</a> ); <a name="l00385"></a>00385 <a name="l00401"></a>00401 <span class="keyword">static</span> <a class="codeRef" href="qstring.html">QString</a> resourceToN3( <span class="keyword">const</span> <a class="codeRef" href="qurl.html">QUrl</a>& resource ); <a name="l00402"></a>00402 <a name="l00418"></a>00418 <span class="keyword">static</span> <a class="codeRef" href="qstring.html">QString</a> blankToN3( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>& blank ); <a name="l00419"></a>00419 <a name="l00436"></a>00436 <span class="keyword">static</span> <a class="codeRef" href="qstring.html">QString</a> literalToN3( <span class="keyword">const</span> <a class="code" href="classSoprano_1_1LiteralValue.html" title="Represents a literal value of an RDF Node.">LiteralValue</a>& literal ); <a name="l00437"></a>00437 <a name="l00444"></a><a class="code" href="classSoprano_1_1Node.html#a5d9a022e2a1478cd5031d3876a793432">00444</a> <span class="keyword">enum</span> <a class="code" href="classSoprano_1_1Node.html#a5d9a022e2a1478cd5031d3876a793432">N3ParserFlag</a> { <a name="l00448"></a><a class="code" href="classSoprano_1_1Node.html#a5d9a022e2a1478cd5031d3876a793432a4c9a788cdd09fca0921554b4e87e28eb">00448</a> NoFlags = 0x0, <a name="l00449"></a>00449 <a name="l00456"></a><a class="code" href="classSoprano_1_1Node.html#a5d9a022e2a1478cd5031d3876a793432a3724a4a9241dc53a1714f5e30f4148e5">00456</a> StrictLiteralTypes = 0x1, <a name="l00457"></a>00457 <a name="l00463"></a><a class="code" href="classSoprano_1_1Node.html#a5d9a022e2a1478cd5031d3876a793432a1b1b6d38f95d2d64d37bd8472c36ebb9">00463</a> StrictUris = 0x2, <a name="l00464"></a>00464 <a name="l00468"></a><a class="code" href="classSoprano_1_1Node.html#a5d9a022e2a1478cd5031d3876a793432a2d2d2729112d95d0ae6bb9eca4add8d5">00468</a> IgnorePrefixes = 0x4 <a name="l00469"></a>00469 }; <a name="l00470"></a>00470 Q_DECLARE_FLAGS( N3ParserFlags, N3ParserFlag ) <a name="l00471"></a>00471 <a name="l00472"></a>00472 <a name="l00484"></a>00484 static <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> fromN3( const <a class="codeRef" href="qstring.html">QString</a>& n3, N3ParserFlags flags = NoFlags ); <a name="l00485"></a>00485 <a name="l00498"></a>00498 static <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a> fromN3Stream( <a class="codeRef" href="qtextstream.html">QTextStream</a>& stream, N3ParserFlags flags = NoFlags ); <a name="l00499"></a>00499 <a name="l00500"></a>00500 private: <a name="l00501"></a>00501 class NodeData; <a name="l00502"></a>00502 class ResourceNodeData; <a name="l00503"></a>00503 class BNodeData; <a name="l00504"></a>00504 class LiteralNodeData; <a name="l00505"></a>00505 <a class="codeRef" href="qshareddatapointer.html">QSharedDataPointer</a><NodeData> d; <a name="l00506"></a>00506 }; <a name="l00507"></a>00507 <a name="l00511"></a>00511 <a class="code" href="soprano__export_8h.html#a4f040b77f4fdd45fda0c3d6ced1e3776">SOPRANO_EXPORT</a> uint <a class="code" href="namespaceSoprano.html#ad6ab842f23f336a1514d9ed0a96d9a91">qHash</a>( const <a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& node ); <a name="l00512"></a>00512 } <a name="l00513"></a>00513 <a name="l00517"></a>00517 <a class="code" href="soprano__export_8h.html#a4f040b77f4fdd45fda0c3d6ced1e3776">SOPRANO_EXPORT</a> QDebug operator<<( QDebug s, const Soprano::<a class="code" href="classSoprano_1_1Node.html" title="A Node represents one RDF resource.">Node</a>& ); <a name="l00518"></a>00518 <a name="l00527"></a>00527 <a class="code" href="soprano__export_8h.html#a4f040b77f4fdd45fda0c3d6ced1e3776">SOPRANO_EXPORT</a> <a class="codeRef" href="qtextstream.html">QTextStream</a>& operator<<( <a class="codeRef" href="qtextstream.html">QTextStream</a>& s, const Soprano::Node& ); <a name="l00528"></a>00528 <a name="l00536"></a>00536 <a class="code" href="soprano__export_8h.html#a4f040b77f4fdd45fda0c3d6ced1e3776">SOPRANO_EXPORT</a> <a class="codeRef" href="qtextstream.html">QTextStream</a>& operator>>( <a class="codeRef" href="qtextstream.html">QTextStream</a>& s, Soprano::Node& ); <a name="l00537"></a>00537 <a name="l00538"></a>00538 <span class="preprocessor">#if QT_VERSION < 0x040700</span> <a name="l00539"></a>00539 <span class="preprocessor"></span><a class="code" href="soprano__export_8h.html#a4f040b77f4fdd45fda0c3d6ced1e3776">SOPRANO_EXPORT</a> uint <a class="code" href="namespaceSoprano.html#ad6ab842f23f336a1514d9ed0a96d9a91">qHash</a>( <span class="keyword">const</span> <a class="codeRef" href="qurl.html">QUrl</a>& <a class="code" href="namespaceSoprano_1_1Vocabulary_1_1Xesam.html#a543e4d14bd5a314116b6c6181248466b">url</a> ); <a name="l00540"></a>00540 <span class="preprocessor">#endif</span> <a name="l00541"></a>00541 <span class="preprocessor"></span> <a name="l00542"></a>00542 Q_DECLARE_OPERATORS_FOR_FLAGS( Soprano::Node::N3ParserFlags ) <a name="l00543"></a>00543 <a name="l00544"></a>00544 <span class="preprocessor">#endif // SOPRANO_NODE_H</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Oct 21 2010 for Soprano by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>