/**
   * @param cg Conflict graph to be serialized
   * @throws IOException
   */
  @Override
  public void serialize(ConflictGraph cg) throws IOException {

    m_xmlWriter.startDocument(Names.CONFLICT_GRAPH_ROOT_ELEMENT_NAME);

    for (Set<ConditionalConstraint> ccSet : cg.getConstraintSets()) {

      m_xmlWriter.writeStartElement(Names.CONFLICT_MAPPING_ELEMENT_NAME);
      m_xmlWriter.writeStartElement(Names.CC_SET_ELEMENT_NAME);
      serializeConstraintSet(ccSet);
      m_xmlWriter.writeEndElement();
      // Now serialize conflict sets
      for (Set<ConditionalConstraint> conflictSet : cg.getConflictSets(ccSet)) {

        m_xmlWriter.writeStartElement(Names.CONFLICT_SET_ELEMENT_NAME);
        serializeConstraintSet(conflictSet);
        m_xmlWriter.writeEndElement();
      }

      m_xmlWriter.writeEndElement();
    }

    m_xmlWriter.endDocument();
  }
Exemplo n.º 2
0
 public void writeStartElement(IRI elementName) throws IOException {
   // Sort out with namespace
   writer.writeStartElement(elementName.toString());
 }