/**
   * @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();
  }
Example #2
0
 private void writeAttribute(String attributeName, IRI value) throws IOException {
   writer.writeAttribute(attributeName, value.toString());
 }
Example #3
0
 public void writeNodeIDAttribute(RDFResourceNode node) throws IOException {
   writer.writeAttribute(Namespaces.RDF + "nodeID", node.toString());
 }
Example #4
0
 public void writeEndElement() throws IOException {
   writer.writeEndElement();
 }
Example #5
0
 public void writeLangAttribute(String lang) throws IOException {
   writer.writeAttribute("xml:lang", lang);
 }
Example #6
0
 public void writeTextContent(String text) throws IOException {
   writer.writeTextContent(text);
 }
Example #7
0
 public void writeDatatypeAttribute(IRI datatypeIRI) throws IOException {
   writer.writeAttribute(Namespaces.RDF + "datatype", datatypeIRI.toString());
 }
Example #8
0
 public void writeParseTypeAttribute() throws IOException {
   writer.writeAttribute(Namespaces.RDF + "parseType", "Collection");
 }
Example #9
0
 public void writeStartElement(IRI elementName) throws IOException {
   // Sort out with namespace
   writer.writeStartElement(elementName.toString());
 }
Example #10
0
 public void writeComment(String comment) throws IOException {
   writer.writeComment(comment);
 }
Example #11
0
 public void endDocument() throws IOException {
   writer.endDocument();
 }
Example #12
0
 public void startDocument() throws IOException {
   writer.startDocument(Namespaces.RDF + "RDF");
 }