Ejemplo n.º 1
0
        private static void WriteNode(XmlWriter writer, string id, string label)
        {
            writer.WriteStartElement(GraphMLSpecsHelper.Node);
            writer.WriteAttributeString(GraphMLSpecsHelper.Id, id);

            GraphMLWriter.WriteData(writer, GraphMLSpecsHelper.NodeLabel, label);

            writer.WriteEndElement();
        }
Ejemplo n.º 2
0
        private static void WriteEdge(XmlWriter writer, Triple triple, bool collapseLiterals)
        {
            writer.WriteStartElement(GraphMLSpecsHelper.Edge);
            writer.WriteAttributeString(GraphMLSpecsHelper.Source, triple.Subject.GetHashCode().ToString());

            writer.WriteStartAttribute(GraphMLSpecsHelper.Target);

            var id = GraphMLWriter.CalculateNodeId(triple.Object, triple, collapseLiterals);

            writer.WriteString(id.GetHashCode().ToString());

            GraphMLWriter.WriteData(writer, GraphMLSpecsHelper.EdgeLabel, triple.Predicate.ToString());

            writer.WriteEndElement();
        }