Dear [email protected],
I am currently working on producing an RDF XML file with a bunch of high
voltage electrical objects in it. I've come a long way, but recently hit
an obstacle because three classes are referencing each other circularly.
Basically, a ShuntCompensator references a RegulatingControl which
references a Terminal which references a ShuntCompensator - and the circle
is thus completed.
It is no problem adding all this to my Model model object, and I can
actually also specify it in my RDFWriter (see below). But the problem is
that one of these classes would always be referenced before it has been
declared, and therefore it gets an rdf:about identifier in a child element
below whatever references it, rather than an rdf:id in a completely "flat"
XML RDF structure (i.e. without any hierarchies in the serialized file). I
find this result weird (an "about" tag doesn't sound like an ID to me) but
recognize that it is probably okay according to the rdf spec. However, the
receiving end of this file requires a completely flat structure and
everything declared using rdf:id attributes. So I am reaching out to ask
if there is a way to tweak Jena's serializer to do this? Surely, there
must be a way to reference something which is declared further down the
file? Since the entire model is already established, I would find it an
odd limitation that such ordering in which elements are serialized should
be a limitation?
RDFWriter writer = model.getWriter("RDF/XML-ABBREV");
writer.setProperty("showXMLDeclaration", true);
writer.setProperty("xmlbase", NS);
writer.setProperty("prettyTypes", new Resource[] {
Ontology.ShuntCompensator,
Ontology.RegulatingControl,
Ontology.Terminal,
...
}
FileOutputStream fos;
fos = new FileOutputStream(filepath);
writer.write(model, fos, null);
Thanks a lot in advance!!
Nis
Nis Jespersen
Advisory IT Architect ? Energy & Utilities Global Center of Competency ?
IBM Global Business Services
+45 41208641 ? [email protected] ? IBM Danmark ApS, Lyngbyvej 2, 2100
Copenhagen, Denmark
-------- ------------- ------- -------
-------- ---------------- -------- --------
---- ---- ----- ------- -------
---- ------------ -------- --------
---- ------------ ---- ------- ----
---- ---- ----- ---- ----- ----
-------- ---------------- ------ --- ------
-------- ------------- ------ - ------
Medmindre andet er angivet ovenfor: / Unless Otherwise Stated Above:
IBM Danmark ApS
Nymøllevej 91
2800 Kongens Lyngby, Danmark
CVR nr.: 65305216