66
66
A Node can have one of four types: EmptyNode, ResourceNode, LiteralNode, and BlankNode.
67
Resource nodes are identified through their URI (uri()), literal nodes have a LiteralValue (literal())
68
and an optional language string (language()), and blank nodes have a string identifier.
67
Resource nodes are identified through their URI (uri()), literal nodes have a LiteralValue (literal()),
68
and blank nodes have a string identifier.
71
71
Empty nodes can be used as wildcards in methods such as Model.listStatements.
74
<dl class="warning" compact><dt><b>Warning:</b></dt><dd> Be aware that string literals in %Soprano always have type
75
xsd:string. There is no direct support for rdfs:Literal. Backend implementations
76
should honour this restriction.
80
75
<dl class="author" compact><dt><b>Author:</b></dt><dd> Daniele Galdi <daniele.galdi@gmail.com><br>Sebastian Trueg <trueg@kde.org> </dd></dl>
82
77
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
83
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#obj202014796">Type</a> </td><td class="memItemRight" valign="bottom">{ EmptyNode, ResourceNode, LiteralNode, BlankNode }</td></tr>
78
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#obj184326252">Type</a> </td><td class="memItemRight" valign="bottom">{ EmptyNode, ResourceNode, LiteralNode, BlankNode }</td></tr>
84
79
<tr><td colspan="2"><br><h2>Methods</h2></td></tr>
85
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj183311980">__init__</a> (self)</td></tr>
86
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj190847660">__init__</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> uri)</td></tr>
87
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj190847532">__init__</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> id)</td></tr>
88
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj190845356">__init__</a> (self, <a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> value, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> language=QString())</td></tr>
89
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj190846700">__init__</a> (self, <a href="../soprano/Soprano.Node.html">Soprano.Node</a> other)</td></tr>
90
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj199494540">dataType</a> (self)</td></tr>
91
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj185600780">identifier</a> (self)</td></tr>
92
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj185601708">isBlank</a> (self)</td></tr>
93
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj197805420">isEmpty</a> (self)</td></tr>
94
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj197807340">isLiteral</a> (self)</td></tr>
95
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj197805196">isResource</a> (self)</td></tr>
96
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj197805900">isValid</a> (self)</td></tr>
97
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj199492876">language</a> (self)</td></tr>
98
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj185598476">literal</a> (self)</td></tr>
99
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj183091724">matches</a> (self, <a href="../soprano/Soprano.Node.html">Soprano.Node</a> other)</td></tr>
100
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj202017964">operator !=</a> (self, <a href="../soprano/Soprano.Node.html">Soprano.Node</a> other)</td></tr>
101
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj190848428">operator ==</a> (self, <a href="../soprano/Soprano.Node.html">Soprano.Node</a> other)</td></tr>
102
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj183092300">operator ==</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> other)</td></tr>
103
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj183093612">operator ==</a> (self, <a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> other)</td></tr>
104
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj199493612">toN3</a> (self)</td></tr>
105
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj199493420">toString</a> (self)</td></tr>
106
<tr><td class="memItemLeft" nowrap align="right" valign="top">Soprano.Node.Type </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj197804460">type</a> (self)</td></tr>
107
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj185600236">uri</a> (self)</td></tr>
80
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj184324204">__init__</a> (self)</td></tr>
81
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj184328140">__init__</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> uri)</td></tr>
82
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj172181292">__init__</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> id)</td></tr>
83
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj184291660">__init__</a> (self, <a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> value)</td></tr>
84
<tr><td class="memItemLeft" nowrap align="right" valign="top">SOPRANO_CONSTRUCTOR </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj184295084">Node</a> (self, <a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> value, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> language)</td></tr>
85
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj188452044">__init__</a> (self, <a href="../soprano/Soprano.Node.html">Soprano.Node</a> other)</td></tr>
86
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj181374796">__init__</a> (self, <a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> value, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> language)</td></tr>
87
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj176538924">dataType</a> (self)</td></tr>
88
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj176540588">identifier</a> (self)</td></tr>
89
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj176539820">isBlank</a> (self)</td></tr>
90
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj171350636">isEmpty</a> (self)</td></tr>
91
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj171350988">isLiteral</a> (self)</td></tr>
92
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj176540012">isResource</a> (self)</td></tr>
93
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj176540972">isValid</a> (self)</td></tr>
94
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj151224204">language</a> (self)</td></tr>
95
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj176538604">literal</a> (self)</td></tr>
96
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj171348684">matches</a> (self, <a href="../soprano/Soprano.Node.html">Soprano.Node</a> other)</td></tr>
97
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj188452748">operator !=</a> (self, <a href="../soprano/Soprano.Node.html">Soprano.Node</a> other)</td></tr>
98
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj188449324">operator ==</a> (self, <a href="../soprano/Soprano.Node.html">Soprano.Node</a> other)</td></tr>
99
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj177537292">operator ==</a> (self, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> uri)</td></tr>
100
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj177538028">operator ==</a> (self, <a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> other)</td></tr>
101
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj165622284">toN3</a> (self)</td></tr>
102
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj151220396">toString</a> (self)</td></tr>
103
<tr><td class="memItemLeft" nowrap align="right" valign="top">Soprano.Node.Type </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj171351660">type</a> (self)</td></tr>
104
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj176539532">uri</a> (self)</td></tr>
108
105
<tr><td colspan="2"><br><h2>Static Methods</h2></td></tr>
109
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj185727916">createBlankNode</a> (<a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> id)</td></tr>
110
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj199495148">createEmptyNode</a> ()</td></tr>
111
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj185727052">createLiteralNode</a> (<a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> value, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> language)</td></tr>
112
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj185725420">createResourceNode</a> (<a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> uri)</td></tr>
106
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj180593132">blankToN3</a> (<a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> blank)</td></tr>
107
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj182997868">createBlankNode</a> (<a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> id)</td></tr>
108
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj165624460">createEmptyNode</a> ()</td></tr>
109
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj171408396">createLiteralNode</a> (<a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> value)</td></tr>
110
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj165475756">createLiteralNode</a> (<a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> value, <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> language)</td></tr>
111
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../soprano/Soprano.Node.html">Soprano.Node</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj185114092">createResourceNode</a> (<a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> uri)</td></tr>
112
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj165637900">literalToN3</a> (<a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> literal)</td></tr>
113
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#obj180596204">resourceToN3</a> (<a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qurl.html">QUrl</a> resource)</td></tr>
114
<hr><h2>Method Documentation</h2><a class="anchor" name="obj183311980"></a>
115
<hr><h2>Method Documentation</h2><a class="anchor" name="obj184324204"></a>
115
116
<div class="memitem">
116
117
<div class="memproto">
117
118
<table class="memname"><tr>
255
297
<td width="100%"> </td>
258
<div class="memdoc"></div></div><a class="anchor" name="obj185727916"></a>
300
<div class="memdoc"><p>Copy constructor.
301
</p></div></div><a class="anchor" name="obj181374796"></a>
302
<div class="memitem">
303
<div class="memproto">
304
<table class="memname"><tr>
305
<td class="memname">__init__</td>
307
<td class="paramtype"> <em>self</em>, </td>
308
<td class="paramname"></td>
310
<td class="memname"></td>
312
<td class="paramtype"><a href="../soprano/Soprano.LiteralValue.html">Soprano.LiteralValue</a> </td>
313
<td class="paramname"><em>value</em>, </td>
316
<td class="memname"></td>
318
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td>
319
<td class="paramname"><em>language</em></td>
326
<td width="100%"> </td>
329
<div class="memdoc"></div></div><a class="anchor" name="obj180593132"></a>
330
<div class="memitem">
331
<div class="memproto">
332
<table class="memname"><tr>
333
<td class="memname"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> blankToN3</td>
335
<td class="paramtype"><a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qstring.html">QString</a> </td>
336
<td class="paramname"><em>blank</em></td>
343
<td width="100%"> </td>
346
<div class="memdoc"><p>Format a blank node identifier as N3 string to be used in SPARQL queries.
349
<dl class="return" compact><dt><b>Returns:</b></dt><dd> A string representing the blank identifier in N3 encoding or an empty
350
string for invalid/empty ids.
354
<pre class="fragment">
362
<dl class="since" compact><dt><b>Since:</b></dt><dd> 2.3
364
</p></div></div><a class="anchor" name="obj182997868"></a>
259
365
<div class="memitem">
260
366
<div class="memproto">
261
367
<table class="memname"><tr>