diff options
Diffstat (limited to 'src/engine/Machine.cpp')
-rw-r--r-- | src/engine/Machine.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/engine/Machine.cpp b/src/engine/Machine.cpp index a2d650d..2d3358b 100644 --- a/src/engine/Machine.cpp +++ b/src/engine/Machine.cpp @@ -218,14 +218,23 @@ Machine::write_state(Raul::RDFWriter& writer) RdfId(RdfId::RESOURCE, "machina:Machine")); for (Nodes::const_iterator n = _nodes.begin(); n != _nodes.end(); ++n) { - if ( ! (*n)->id() ) - (*n)->set_id(writer.blank_id()); - + (*n)->write_state(writer); writer.write(RdfId(RdfId::RESOURCE, ""), RdfId(RdfId::RESOURCE, "machina:node"), (*n)->id()); + + for (Node::EdgeList::const_iterator e = (*n)->outgoing_edges().begin(); + e != (*n)->outgoing_edges().end(); ++e) { + + (*e)->write_state(writer); + + writer.write(RdfId(RdfId::RESOURCE, ""), + RdfId(RdfId::RESOURCE, "machina:edge"), + (*e)->id()); + } + } } |