Simon: patches to RDF support
This commit is contained in:
parent
b0923f64a3
commit
eaa50ca9fc
1 changed files with 9 additions and 4 deletions
|
@ -697,9 +697,14 @@ __Serializer.prototype.statementsToXML = function(sts) {
|
||||||
t = qname(st.predicate);
|
t = qname(st.predicate);
|
||||||
switch (st.object.termType) {
|
switch (st.object.termType) {
|
||||||
case 'bnode':
|
case 'bnode':
|
||||||
|
if(sz.incoming[st.object].length == 1) {
|
||||||
results = results.concat(['<'+ t +'>',
|
results = results.concat(['<'+ t +'>',
|
||||||
subjectXMLTree(st.object, stats),
|
subjectXMLTree(st.object, stats),
|
||||||
'</'+ t +'>']);
|
'</'+ t +'>']);
|
||||||
|
} else {
|
||||||
|
results = results.concat(['<'+ t +' rdf:nodeID="'
|
||||||
|
+st.object.toNT().slice(2)+'"/>']);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'symbol':
|
case 'symbol':
|
||||||
results = results.concat(['<'+ t +' rdf:resource="'
|
results = results.concat(['<'+ t +' rdf:resource="'
|
||||||
|
@ -728,7 +733,7 @@ __Serializer.prototype.statementsToXML = function(sts) {
|
||||||
var attrs = '';
|
var attrs = '';
|
||||||
if (subject.termType == 'bnode') {
|
if (subject.termType == 'bnode') {
|
||||||
if(sz.incoming[subject].length != 1) { // not an anonymous bnode
|
if(sz.incoming[subject].length != 1) { // not an anonymous bnode
|
||||||
attrs = ' rdf:ID="'+subject.toNT().slice(2)+'"';
|
attrs = ' rdf:nodeID="'+subject.toNT().slice(2)+'"';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
attrs = ' rdf:about="'+ relURI(subject)+'"';
|
attrs = ' rdf:about="'+ relURI(subject)+'"';
|
||||||
|
|
Loading…
Reference in a new issue