-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Currently the XML serialization is all in long hand. It would be good to have some of the short hand syntaxes, for example typed nodes and the ability to remove explicit BNode IDs where possible.
For example:
f.format(&Triple {
subject: NamedNode { iri: "http://top.level/top_sub" }.into(),
predicate: NamedNode { iri: "http://top.level/top_pred" }.into(),
object: BlankNode{id:&bnid}.into()
})?;
f.format(&Triple {
subject: BlankNode{id:&bnid}.into(),
predicate: NamedNode{iri: "http://one.deep/one_pred"}.into(),
object: NamedNode{iri: "http://one.deep/one_obj"}.into()
})?;currently produces
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://top.level/top_sub">
<top_pred xmlns="http://top.level/" rdf:nodeID="bn1"/>
</rdf:Description>
<rdf:Description rdf:nodeID="bn1">
<one_pred xmlns="http://one.deep/" rdf:resource="http://one.deep/one_obj"/>
</rdf:Description>
</rdf:RDF>where as something like this:
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns="http://top.level/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:default1="http://one.deep/"
>
<rdf:Description rdf:about="http://top.level/top_sub">
<top_pred>
<rdf:Description>
<default1:one_pred rdf:resource="http://one.deep/one_obj"/>
</rdf:Description>
</top_pred>
</rdf:Description>
</rdf:RDF>would be better. Combined with the other short cut syntaxes, this will make a big difference to eventual file size!
Metadata
Metadata
Assignees
Labels
No labels