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