Git Product home page Git Product logo

graphml-schemas's Introduction

Purpose

This repository hosts the XML schema definition files for the Network Canvas extensions to GraphML. We needed to extend the GraphML format so that we could store Network Canvas meta data in the files, such as interview protocol, case ID, and session UUID.

A key aim of this process has been to ensure interoperability with existing GraphML parsers. If you encounter a compatibility issue, please file an issue against this repository!

Schema extensions

Our extensions provide namespaced attributes on the <graph> element: nc:caseId, nc:sessionUUID, nc:protocolName, nc:protocolUID, nc:sessionExportTime, nc:sessionStartTime, and nc:sessionFinishTime.

The schema nc-types.xsd defines these attributes, and graphml+netcanvas.xsd extends the element to include them.

These data contain network canvas metadata for sessions needed for importing into Server.

Ego data

Storing ego data is possible using the existing GraphML schema, although only in a general sense (arbitrary data can be attached to the graph element). Existing parsers either ignore this data, or just show it (correctly) as one or more attributes of the graph itself. Our parsers will treat all graph <key> and <data> nodes as describing ego.

Specifically, ego data can be stored within GraphML just like we store node or edge data, except that instead of defining the element with a "for" attribute of either 'node' or 'edge', we can define them as for the graph:

<key id="ego_attribute" attr.name="ego_attribute" attr.type="string" for="graph" />

Note: the key must be located outside of the <graph> element.

We can then give this attribute a value anywhere inside the <graph> element:

<graph>
  <data key="ego_attribute">Jimbo</data>
</graph>

Sample GraphML document

See the contents of minimal.graphml:

Multiple networks in one file

The most compatible way to approach this problem is to have multiple <graph> nodes, with each representing an ego network. Node, Edge, and Ego attribute definitions would share <key>s, with the definitions within each graph. See the example in minimal-multiple-networks.graphml for an implementation of this.

Unfortunately, testing in Gephi, networkX, iGraph, visone, and yEd indicates that no currently available software correctly handles this feature of the graphML language. If you find one that does, please let us know.

If you are a developer who wants to correctly implement our multiple network format, please get in touch!

Validating a file against this schema

To validate your graphML file against our extensions, please use the following command

xmllint --noout --schema http://schema.networkcanvas.com/xmlns/1.0/graphml+netcanvas.xsd --load-trace  file.graphml

Please note that xmllint does not support using HTTPS!

graphml-schemas's People

Contributors

jthrilly avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.