diff --git a/README.md b/README.md index e0506f2..a7f2677 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,22 @@ # GEXF Format -GEXF file format specifications. Details and examples at [gexf.net](http://gexf.net). +GEXF file format specifications. Details and examples at [gexf.net](http://gexf.net). The repository contains both the [specifications](specs) and the [primer](primer) sources. -The latest **stable** version in **1.3**. +The latest **stable** version in **1.3.1**. # Changelog Note that we used to use "draft" in certain version (e.g "1.2draft") up until 1.3 when we decided to simply use full versions numbers. +## 1.3.1 + +Compatible with Gephi 0.9.10? and above. The general purpose of this version is to embed enough information in the GEXF to ease legend drawing aside the graph. + +- Add `title` element in `meta` +- Extend the `viz` module with scaling information. It describes how the `viz` attributes were calculated from node/edge attributes + ## 1.3 Compatible with Gephi 0.9.3 and above. Note that part of the specifications were already implemented since 0.9 but full support is only guaranteed in 0.9.3. @@ -76,7 +83,7 @@ Compatible with Gephi 0.8 and above. Compatible with Gephi 0.7 and above. -- Modules are stabilized and new ones appear: hierarchy and phylogeny. +- Modules are stabilized and new ones appear: hierarchy and phylogeny. ## 1.0 diff --git a/primer/1.3.1/build.sh b/primer/1.3.1/build.sh new file mode 100755 index 0000000..df3d3ef --- /dev/null +++ b/primer/1.3.1/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +./compile.sh +./pdf.sh +# ./xhtml.sh does not work diff --git a/primer/1.3.1/compile.sh b/primer/1.3.1/compile.sh new file mode 100755 index 0000000..ce7773f --- /dev/null +++ b/primer/1.3.1/compile.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +prefix=gexf-131-primer + +# Compile +latex -interaction=nonstopmode $prefix.tex +makeindex $prefix.idx +latex -interaction=nonstopmode $prefix.tex + diff --git a/primer/1.3.1/gexf-131-primer.tex b/primer/1.3.1/gexf-131-primer.tex new file mode 100755 index 0000000..e07d5c4 --- /dev/null +++ b/primer/1.3.1/gexf-131-primer.tex @@ -0,0 +1,1398 @@ +\documentclass[a4paper,10pt]{article} + +\usepackage[utf8x]{inputenc} +\usepackage{makeidx} +\usepackage{listings} +\usepackage{color} +\usepackage{graphicx} +\usepackage{hyperref} + +%\usepackage{html} % *always* load this for LaTeX2HTML +%\begin{htmlonly} +% \usepackage{verbatim} +% \providecommand{\lstlisting}[2][]{\verbatiminput{#2}} +%\end{htmlonly} + +\input colordvi +\definecolor{lightblue}{rgb}{.3,.5,1} +\definecolor{orange}{rgb}{1,.7,0} +\definecolor{darkorange}{rgb}{1,.4,0} +\definecolor{darkgreen}{rgb}{0,.4,0} +\definecolor{darkblue}{rgb}{0,0,.4} +\definecolor{darkred}{rgb}{.56,0,0} +\definecolor{gray}{rgb}{.3,.3,.3} +\definecolor{darkgray}{rgb}{.2,.2,.2} +\definecolor{shadecolor}{gray}{0.925} + +\input{sty/gexf.sty} +\input{sty/rnc.sty} +%\input{sty/xml.sty} + +\hypersetup{ + bookmarks=true, % show bookmarks bar? + unicode=false, % non-Latin characters in Acrobat’s bookmarks + pdftoolbar=true, % show Acrobat’s toolbar? + pdfmenubar=true, % show Acrobat’s menu? + pdffitwindow=false, % window fit to page when opened + pdfstartview={FitH}, % fits the width of the page to the window + pdftitle={GEXF 1.3 Primer}, % title + pdfauthor={GEXF Working Group}, % author + pdfsubject={GEXF 1.3 Primer}, % subject of the document + pdfcreator={GEXF Working Group}, % creator of the document + pdfproducer={GEXF Working Group}, % producer of the document + pdfkeywords={gephi gexf graph}, % list of keywords + pdfnewwindow=true, % links in new window + colorlinks=false, % false: boxed links; true: colored links + linkcolor=red, % color of internal links + citecolor=green, % color of links to bibliography + filecolor=magenta, % color of file links + urlcolor=cyan % color of external links +} + +\makeindex + + +%opening +\title{GEXF 1.3.1 Primer} +\author{GEXF Working Group} + +\begin{document} + +\maketitle + +\begin{abstract} +GEXF Primer is a non-normative document intended to provide an easily readable description of the GEXF facilities, and is oriented towards quickly understanding how to create GEXF documents. This primer describes the language features through examples which are complemented by references to normative texts. Specification is in \href{http://relaxng.org/compact-tutorial-20030326.html}{RelaxNG Compact} grammar. +\end{abstract} + +\tableofcontents + +\section{Introduction} \label{introduction} + +\paragraph{} +This document, GEXF Primer, provides an description of GEXF, and should be used alongside the formal descriptions of the language contained in the GEXF specification. The intended audience of this document includes application developers whose programs read and write GEXF files, and users who want to communicate with programs using GEXF import/export. The text assumes that you have a basic understanding of XML 1.0 and XML-Namespaces. Basic knowledge of XML Schema is also assumed for some parts of this document. Each major section of the primer introduces new features of the language, and describes those features in the context of concrete examples. + +\paragraph{} +Section 2 covers the basic mechanisms of GEXF. It describes how to declare a simple graph by defining its nodes and edges and how to add simple user data to the graph. + +\paragraph{} +Section 5 describes dynamic graph model (i.e. graphs over time). + +\paragraph{} +Section 6 describes mechanisms for extending GEXF to add specific data with the Visualization module in example. + +\paragraph{} +The primer is a non-normative document, which means that it does not provide a definitive specification of the GEXF language. The examples and other explanatory material in this document are provided to help you understand GEXF, but they may not always provide definitive answers. In such cases, you will need to refer to the GEXF specification, and to help you do this, we provide many links pointing to the relevant parts of the specification. + +\paragraph{} +In this document, we may use the terms network and graph interchangeably. + +\section{Basic Concepts} \label{basic} + +The purpose of a GEXF document is to define a graph representing a network. Let us start by considering the minimal graph shown in the figure below. It contains 2 nodes and 1 edge. + +\begin{figure}[!ht] + \begin{center} + \includegraphics[scale=0.15]{res/simple.png} + \caption{Hello-world graph} + \end{center} +\end{figure} + +\subsection{A Simple Graph} + +This is a dummy graph: + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Hello world!},label=helloworld] + + + + Gephi.org + Hello World! + A hello world! file + + + + + + + + + + + +\end{lstlisting} + +The GEXF document consists of a gexf element and a variety of subelements. In the remainder of this section we will discuss these elements in detail and show how they define a graph. + +\subsection{Header} + +In this section we discuss the parts of the document which are common to all GEXF documents, basically the gexf element and the meta declaration. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Header},label=header] + + + + Gephi.org + Hello World! + A hello world! file + basic, web + + ... + +\end{lstlisting} + +\paragraph{} +The first line of the document is an XML process instruction which defines that the document adheres to the XML 1.0 standard and that the encoding of the document is UTF-8, the standard encoding for XML documents. Of course other encodings can be chosen for GEXF documents. + +\paragraph{} +The second line contains the root-element element of a GEXF document: the gexf element. The gexf element, like all other GEXF elements, belongs to the namespace \begin{footnotesize}http://gexf.net/1.3.1\end{footnotesize}. For this reason we define this namespace as the default namespace in the document by adding the XML Attribute \begin{footnotesize}xmlns="http://gexf.net/1.3.1"\end{footnotesize} to it. The two other XML Attributes are needed to specify the XML Schema for this document. In our example we use the standard schema for GEXF documents located on the gexf.net server. The first attribute, \begin{footnotesize}xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\end{footnotesize}, defines xsi as the XML Schema namespace. The second attribute, \begin{footnotesize}xsi:schemaLocation ="http://gexf.net/1.3.1 http://gexf.net/1.3.1/gexf.xsd"\end{footnotesize}, defines the XML Schema location for all elements in the GEXF namespace. + +\paragraph{} +The XML Schema reference is not required, but it provides means to validate the document and is therefore strongly recommended. + +\paragraph{} +The \begin{footnotesize}meta\end{footnotesize} element contains additional information about the network. Element leafs are assumed to be text, and \begin{footnotesize}lastmodifieddate\end{footnotesize} is an international standard date (yyyy-mm-dd). The \begin{footnotesize}graph\end{footnotesize} element must be declared after the \begin{footnotesize}meta\end{footnotesize} element. + +\subsection{Network Topology} \label{networktopology} + +The network topology structure containing nodes and edges is called the graph. A graph is, not surprisingly, denoted by a \begin{footnotesize}graph\end{footnotesize} element. Nested inside a graph element are the declarations of nodes and edges. A node is declared with the \begin{footnotesize}node\end{footnotesize} element inside a \begin{footnotesize}nodes\end{footnotesize} element, and an egde with the \begin{footnotesize}edge\end{footnotesize} element inside an \begin{footnotesize}edges\end{footnotesize} element. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={The definition of the graph},label=topology] + + + + + ... + + + + ... + + +\end{lstlisting} + +\subsubsection{Declaring a Graph} + +Graphs in GEXF are mixed, in other words, they can contain directed and undirected edges at the same time. If no direction is specified when an edge is declared, the default direction \begin{footnotesize}defaultedgetype\end{footnotesize} is applied to the edge. + +The default direction is declared as the optional XML-attribute \begin{footnotesize}defaultedgetype\end{footnotesize} of the \begin{footnotesize}graph\end{footnotesize} element. The three possible values for this XML-attribute are \textit{directed}, \textit{undirected} and \textit{mutual}. Note that the default direction is optional and would be assumed as \textit{undirected}. + +The optional XML-attribute \begin{footnotesize}mode\end{footnotesize} set the kind of network: static or dynamic. The latter provides time support (see the section \ref{dynamics} on Dynamics). Static mode is assumed by default. + +The \begin{footnotesize}edges\end{footnotesize} element must be declared after the \begin{footnotesize}nodes\end{footnotesize} element. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={An empty graph!},label=aGraph] + + + + + + +\end{lstlisting} + +\subsubsection{Declaring a Node} + +Nodes in the graph are declared by the \begin{footnotesize}node\end{footnotesize} element. Each node has an identifier, which must be unique within the entire document, i.e., in a document there must be no two nodes with the same identifier. The identifier of a node is defined by the XML-attribute \begin{footnotesize}id\end{footnotesize}, which is a string. Each node also may have a XML-attribute \begin{footnotesize}label\end{footnotesize} that acts as a description, which is a string. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={A node!},label=aNode] + +\end{lstlisting} + +\subsubsection{Declaring an Edge} + +Edges in the graph are declared by the \begin{footnotesize}edge\end{footnotesize} element. Each edge must define its two endpoints with the XML-Attributes \begin{footnotesize}source\end{footnotesize} and \begin{footnotesize}target\end{footnotesize}. The value of the source, resp. target, must be the identifier of a node in the same document. The identifier of an edge is defined by the XML-Attribute \begin{footnotesize}id\end{footnotesize} and is optional. There is no order notion applied to edges. + +\paragraph{} +Edges with only one endpoint, also called loops, selfloops, or reflexive edges, are defined by having the same value for source and target. + +\paragraph{} +Each edge can have a optional XML-attribute \begin{footnotesize}label\end{footnotesize}, which is a string. + +\paragraph{} +The optional XML-attribute \begin{footnotesize}type\end{footnotesize} declares if the edge is \textit{directed}, \textit{undirected} or \textit{mutual} (directed \textit{from source to target and from target to source}). If the direction is not explicitely defined, the default direction is applied to this edge as defined in the enclosing graph via the `defaultedgetype` attribute. The edge's endpoint are called source and target regardless whether the edge is directed or not. + +\paragraph{} +The weight of the edge is set by the optional XML-attribute \begin{footnotesize}weight\end{footnotesize} and is a double. By default, the weight is \begin{footnotesize}1.0\end{footnotesize} and zero should be avoided although it's not explicitly forbidden. + +\paragraph{} +Assuming two nodes having respectively the \begin{footnotesize}id\end{footnotesize} value set to \textit{0} and \textit{1}: + +\lstset{ style=gexf } +\begin{lstlisting}[caption={An edge!},label=anEdge] + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={A more complete edge},label=aMoreEdge] + +\end{lstlisting} + +\subsubsection{Parallel edges} + +A multigraph is a graph where multiple edges can exist between two nodes. +GEXF supports this type of graph. +Note that this is different from hypergraph, which GEXF doesn't support. + +\paragraph{} +Parallel edges must include the additional \textit{kind} attribute to characterise the edge. The triplet source-target-kind must still be unique. In other words, only parallel edges of different kinds can exist in GEXF. The \textit{kind} attribute is a string. In case the graph doesn't have any parallel edges, \textit{kind} can be omitted. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Parallel edges},label=paralelEdge] + + +\end{lstlisting} + +\subsection{Network Data} \label{networkdata} + +\paragraph{} +In the previous section we discussed how to describe the topology of a graph in GEXF. In this section we see how additional data can be associated with nodes and edges. + +\paragraph{} +A bunch of data can be stored within attributes. The concept is the same as table data or SQL. An attribute has a title/name and a value. Attribute’s name/title must be declared for the whole graph. It could be for instance “degree”, “valid” or “url”. Besides the name of the attribute a column also contains the type. + +\subsubsection{Data types} + +\paragraph{} +GEXF uses the XML Schema Data Types (\href{http://www.w3.org/TR/xmlschema-2/}{XSD 1.1}) for the following primitives: \href{http://www.w3.org/TR/xmlschema-2/#string}{string}, \href{http://www.w3.org/TR/xmlschema-2/#integer}{integer}, \href{http://www.w3.org/TR/xmlschema-2/#long}{long}, \href{http://www.w3.org/TR/xmlschema-2/#float}{float}, \href{http://www.w3.org/TR/xmlschema-2/#double}{double}, \href{http://www.w3.org/TR/xmlschema-2/#boolean}{boolean}, \href{http://www.w3.org/TR/xmlschema-2/#short}{short}, \href{http://www.w3.org/TR/xmlschema-2/#byte}{byte}, \href{http://www.w3.org/TR/xmlschema-2/#date}{date}, and \href{http://www.w3.org/TR/xmlschema-2/#anyURI}{anyURI}. + +\paragraph{} +In addition, GEXF supports additional Data Types: bigdecimal, biginteger, char, liststring, listboolean, listinteger, listlong, listfloat, listdouble, listbyte, listshort, listbigdecimal, listinteger and listchar. + +\subsubsection{Attributes Example} + +Each Node of this graph has three attributes : an url, an indegree value and a boolean for french websites which is set to \textit{true} by default. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={A (small) Web Graph},label=webgraph] + + + + Gephi.org + A Web network + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +\end{lstlisting} + + +\subsubsection{Declaring Attributes} + +Attributes are declared inside an \begin{footnotesize}attributes\end{footnotesize} element. The XML-attribute \begin{footnotesize}class\end{footnotesize} apply nested attributes on nodes (\textit{node} value) or edges (\textit{edge} value). You need to specify the data type in \begin{footnotesize}type\end{footnotesize} and may specify a default value. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Attributes Definition},label=attributesDef] + + + + + + + + + 2.0 + + + ... + +\end{lstlisting} + +Note about the \textit{options} attribute: it defines the available values, separated by a coma and surrounded by brackets. It is both used as a type constraint and for parser optimization. The combined default value must be an available option, like the following example. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Options},label=optionsDef] + + + + foo + [foo, bar, foobar] + + + 5 + [1, 2, 5, 6] + + + ... + +\end{lstlisting} + +\subsubsection{Defining Attribute Values} + +You may understand attributes while looking at this node definition. Besides native fields (id, label), node values are set for three attributes. Omitting an attribute will set the default value as its value. If no default value is set, the value will be empty. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Node Attributes},label=nodeattributes] + + + + + + + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Edge Attributes},label=edgeattributes] + + + + + +\end{lstlisting} + +\subsubsection{List Attributes} + +GEXF offers list data types liststring, listboolean, listinteger, listlong, listfloat, listdouble, listbyte, listshort, listbigdecimal, listinteger and listchar. + +The list format is coma separated surrounded by brackets. For instance \begin{footnotesize}[1, 2, 3]\end{footnotesize} or \begin{footnotesize}[foo, bar]\end{footnotesize}. It supports single and double quotes for text, for instance \begin{footnotesize}['foo', 'bar']\end{footnotesize}. An empty list is simply \begin{footnotesize}[]\end{footnotesize}. + +Note that list attributes are an unsafe types! Values are therefore parsed, and this parsing may fail in certain complex cases. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Liststring Definition},label=liststringDef] + + + + + + ... + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Liststring usage},label=liststringUse] + + + + + +\end{lstlisting} + +A complete example: + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Boolean version},label=boolVersion] + + + + + + + + + + + +\end{lstlisting} + +Also note that when the \textit{options} attribute is used for lists, it gives all possible elements of the list: + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Valid values},label=validVal] + + + [foo1, foo2, foo3] + + + + + + + + + + + + + + + + + + + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Invalid value foo4},label=invalidVal] +... + + + + + +\end{lstlisting} + +\section{Advanced Concepts I: Hierarchy structure} \label{hierarchy} + +\subsection{Introduction} + +GEXF format allows creating hierarchical graph structure essentially for clustering representation. We modelize both a tree structure of ancestors and descendents, and a flat graph of nodes bound by edges. + +\begin{figure}[!ht] + \begin{center} + \includegraphics[width=10cm,keepaspectratio=true]{res/hierarchy.png} + \caption{Graph tree with a virtual edge from a cluster to a leaf} + \end{center} +\end{figure} + +\paragraph{} +Two ways are available: +\begin{enumerate} + \item Nodes can simply host other nodes and so on. + \item Each node refers to a parent node id with the XML-attribute \begin{footnotesize}pid\end{footnotesize}. +\end{enumerate} + +The first style is preferred when the structure written is previously ordered. Sequential reading of this kind of GEXF is safe because no node reference is used. But in the case your program can't provide this, the second way allows writing (and then reading) nodes randomly, but linear reading is at your own risks. + +\subsection{Sequential-safe Reading} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={First way},label=hierarchy1] + + + + + + + + + + + + + + + + + + + + + + + + + + +\end{lstlisting} + +Note that edges are not necessarily written at the end: +\lstset{ style=gexf } +\begin{lstlisting}[caption={First way with edges inside clusters},label=hierarchy11] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +\end{lstlisting} + +\subsection{Random Writing} + +If you can't structure your graph topology before writing a GEXF file, you may use the second style. Nodes sent to Gephi from a live data source, i.e. a web crawler, are written like this. Note that edges are always written randomly. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Second way},label=hierarchy2] + + + + + + + + + +\end{lstlisting} + +With using \begin{footnotesize}pid\end{footnotesize}, node order doesn't matter. An implementation should manage the case when a node reference (pid) is used before the node declaration. This listings could also be: + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Second way randomized},label=hierarchy22] + + + + + + + + + +\end{lstlisting} + + +\section{Advanced Concepts II: Phylogeny structure} \label{phylogeny} + +Multiple parents can be addressed with the following syntax, where a and b are c's parents: +\lstset{ style=gexf } +\begin{lstlisting}[caption={Multiple parents},label=phylogeny1] + + + + + + + + + + +\end{lstlisting} + +\section{Advanced Concepts III: Dynamics} \label{dynamics} + +As networks dynamics is a growing topic of research, GEXF format includes extensive time support. Enable it by setting the \begin{footnotesize}mode\end{footnotesize} attribute of the graph to \textit{dynamic}. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Dynamic Enabled!},label=dynamicEnabled] + + ... + +\end{lstlisting} + +Both network topology and attributes can be dynamic. Time values in GEXF can be represented either via numbers or date or date plus time. In addition, the time representation can either use timestamps or intervals. We'll go into more details later. In the example below is uses the date time format and the default interval time representation. + +\subsection{Example} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={A (small) Dynamic Web Graph with date format},label=dynwebgraph] + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +\end{lstlisting} + +\subsection{Time representation} + +GEXF aims to offer equivalent features for both time representations: \textit{timestamp} and \textit{intervals}. Timestamps are unique points in time while intervals can represent a duration and may include infinity as one of its bounds. + +\paragraph{} +The two time representations can't however be mixed in GEXF and should be defined and consistent throughout the graph. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Timestamp Time Representation}] + +... + +\end{lstlisting} + +The default time representation is \begin{footnotesize}interval\end{footnotesize} to be backward compatible with previous GEXF versions as the timestamp representation is only introduced in 1.3. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Interval Time Representation}] + +... + +\end{lstlisting} + +Note that intervals are always defined with a pair of attributes \textit{start} and \textit{end}. Omitting one of the two translates into an infinity bound. For instance, \begin{footnotesize}node id="0" label="Foo" start="2005"\end{footnotesize} translates into a \begin{footnotesize}[2005, +INF]\end{footnotesize} interval for the node. + +\subsection{Time format} + +Time in GEXF can be encoded in two ways: via numbers or via dates and times. This is controlled via the \begin{footnotesize}timeformat\end{footnotesize} attribute set on the graph element. + +\paragraph{} +As a number, it is an \textit{integer} or a \textit{double}. As a date, it is encoded as an international standard \textit{date} (yyyy-mm-dd) or a \textit{dateTime} defined by the corresponding \href{http://www.w3.org/TR/xmlschema-2/#dateTime}{XSD Datatype}. If omitted, the default type is \textit{double}. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Double format}] + + + + + ... + + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Date format}] + + + + + ... + + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Datetime format (also with timezone)}] + + + + + + ... + + +\end{lstlisting} + +The timezone can also set globally for the entire graph via the \begin{footnotesize}timezone\end{footnotesize} graph attribute. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Global timezone setting}] + +... + +\end{lstlisting} + +\subsection{Dynamic Topology} + +Graph nodes and edges can exist at various points in time. Existence in time can be represented in different ways. + +\subsubsection{Unique interval or timestamp} + +The simplest way is by setting a pair of \begin{footnotesize}start\end{footnotesize} and \begin{footnotesize}end\end{footnotesize} for the interval time representation and \begin{footnotesize}timestamp\end{footnotesize} for the timestamp time representation. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Node Scope Example with Intervals}] + + + + + ... + + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Node Scope Example with Timestamps}] + + + + + ... + + +\end{lstlisting} + +Each edge must declare time limits inside the join scope of its \begin{footnotesize}source\end{footnotesize} and \begin{footnotesize}target\end{footnotesize} nodes: +\begin{itemize} + \item edge.start $\le$ (source.start and target.start) + \item edge.end $\ge$ (source.end and target.end) +\end{itemize} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Edge Scope Example}] + + + + ... + + + + +\end{lstlisting} + +Important: \begin{footnotesize}start\end{footnotesize} and \begin{footnotesize}end\end{footnotesize} values are inclusive, i.e. the following line is allowed: + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Smallest time scope}] + +\end{lstlisting} + +And of course the \begin{footnotesize}end\end{footnotesize} value must be equal or later than the \begin{footnotesize}start\end{footnotesize} value. + +\subsubsection{Spells} + +If a node or an edge exists at multiple timestamps or intervals, we use the concept of spells. Use the xml-element \begin{footnotesize}spells\end{footnotesize} for topology like this: + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Node with multiple spells (Intervals)}] + + + + + + + + + ... + + +\end{lstlisting} + +If no \begin{footnotesize}start\end{footnotesize} is provided, the spell begins with the network. If no \begin{footnotesize}end\end{footnotesize} is provided, the spell ends with the network. If two spells are covering a same period of time, parsers should consider them as a unique spell. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Node with multiple spells (Timestamps)}] + + + + + + + + + ... + + +\end{lstlisting} + +If spells are provided, only their content are taken into account and other time attributes on the element like \begin{footnotesize}timestamp\end{footnotesize} will be ignored. + +\paragraph{} +Important: Intervals can't overlap for an element. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Overlapping intervals (not allowed)}] + + + + + + + + + ... + + +\end{lstlisting} + +\subsubsection{Alternative to spells} + +For a more compact spell representation, GEXF also offers \begin{footnotesize}timestamps\end{footnotesize} and \begin{footnotesize}intervals\end{footnotesize} attributes as lists. It's however less safe as it relies more heavily on the parser. Make sure to check the following examples. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Timestamp list (Date)}] +> + + + ... + + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Timestamp list (Double)}] +> + + + ... + + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Interval list (Double)}] +> + + + ... + + +\end{lstlisting} + +Note that the separator between intervals is a semi-colon as the comma is reserved for the interval itself. + +\paragraph{} +About the weight: dynamic weight can be used with the reserved \textit{title} "weight" in attributes. In dynamic mode, the static XML-attribute \textit{weight} should be ignored if the dynamic one is provided. + +\subsection{Dynamic Data} + +Node and edges data can take different values over time. Attributes must be declared as dynamic, allowing values to exist for a given time. + +\subsubsection{Declaring Dynamic Attributes} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Indegree may change over time}] + + ... + + + + ... + + ... + + +\end{lstlisting} + +\subsubsection{Defining Dynamic Values} + +Attvalues have their scopes limited by the xml-attributes \begin{footnotesize}start\end{footnotesize} and \begin{footnotesize}end\end{footnotesize}. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Data value changing over time}] + + + + + + +\end{lstlisting} + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Using timestamp representation}] + + + + + + + +\end{lstlisting} + +\subsubsection{Dynamic Values and Spells} + +If an \begin{footnotesize}attvalue\end{footnotesize} is covering a period out of any spell, this period should be ignored by parsers. In the following example, the day 2009-01-03 is ignored: + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Spells and attvalues}] + + ... + + + + + + + + + + + ... + + +\end{lstlisting} + +\section{Advanced Concepts IV: Extending GEXF} \label{extendgexf} + +GEXF is designed to be easily extensible. Additional namespaces are defined by an XML Schema. The default namespace is always the gexf namespace. Gephi team actually provides a module for storing visualization data called \textit{viz}. + +\subsection{VIZ module} \label{viz} + +Using the visualization module must be declared by adding the XML Attribute \begin{footnotesize}xmlns:viz="http://gexf.net/1.3.1/viz"\end{footnotesize} to the document namespaces. The \begin{footnotesize}xsi:schemaLocation\end{footnotesize} attribute includes the XML-Schema declaration of the VIZ module. The RelaxNG Compact specification is available in \href{http://gexf.net/1.3.1/viz.rnc}{viz.rnc}, and independent XSD declaration in \href{http://gexf.net/1.3.1/viz.xsd}{viz.xsd}. + +\paragraph{} +Color, position, size and shape are stored as attributes. + +\subsubsection{Viz attributes} + +\paragraph{Node Example} + +The following gexf contains a node having a color, a position, a shape and a specified size. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={VIZ Attributes},label=vizattr] + +... + + + + + + +... + +\end{lstlisting} + +\paragraph{Edge Example} + +The following gexf contains an edge having a color, a thickness and a shape. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={VIZ Attributes},label=vizattr] + +... + + + + + +... + +\end{lstlisting} + +\paragraph{Color} + +Colors are defined by the \href{http://en.wikipedia.org/wiki/RGBA}{RGBA color model}. Each XML-attribute value \begin{footnotesize}r\end{footnotesize}, \begin{footnotesize}g\end{footnotesize} or \begin{footnotesize}b\end{footnotesize} is hence an integer from 0 to 255, and the alpha value \begin{footnotesize}a\end{footnotesize} is a float from 0.0 to 1.0. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={VIZ Color Declaration},label=vizcolor] + +\end{lstlisting} + +Colors can alternatively be defined with a unique \begin{footnotesize}hex\end{footnotesize} attribute. It can still be combined with the alpha parameter + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Color Hex Attribute},label=vizhex] + +\end{lstlisting} + +\paragraph{Position} + +Space positions are set in three dimensions called \begin{footnotesize}x\end{footnotesize}, \begin{footnotesize}y\end{footnotesize} and \begin{footnotesize}z\end{footnotesize}. Note that Gephi associates \begin{footnotesize}z\end{footnotesize} (optional) as the height, and most of layout algorithms only use \begin{footnotesize}x\end{footnotesize} and \begin{footnotesize}y\end{footnotesize}. They are floats. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={VIZ Position Declaration},label=vizposition] + +\end{lstlisting} + +\paragraph{Size} + +Node size is a scale. It is set to \textit{1.0} by default and is a non-negative float. Network viz softwares assume that an object representing a node of size \textit{2.0} is twice bigger as one of \textit{1.0}. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={VIZ Size Declaration},label=vizsize] + +\end{lstlisting} + +\paragraph{Thickness} + +Edge thickness is a scale. It is set to \textit{1.0} by default and is a non-negative float. Network viz softwares assume that an object representing an edge of thickness \textit{2.0} is twice bigger as one of \textit{1.0}. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={VIZ Thickness Declaration},label=vizthickness] + +\end{lstlisting} + +\paragraph{Node Shape} + +Default node is shaped as a disc. Four shapes are proposed: \textit{disc}, \textit{square}, \textit{triangle} and \textit{diamond}. Images require an additional xml-attribute to set their location: \begin{footnotesize}uri\end{footnotesize}. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Image Declaration},label=vizimage] + +\end{lstlisting} + +\paragraph{Edge Shape} + +Default edge is shaped as solid. Four shapes are proposed: \textit{solid}, \textit{dotted}, \textit{dashed} and \textit{double}. + +\subsubsection{Scale} + +The nodes/edges viz attributes described in previous section are stored as static data. This means that they don't mention why the viz:color has been set to this particular value. It's encoded as if the color has been chosen by hand without any data logic. But very often those viz attributes are actually computed from data attributes using for instance the Partition/Ranking features in Gephi. +The scale features are meant to be able to inform Gexf consumers about the viz attributes logic in order to support legend drawing aside visualizing the graph. + +Scales can be described at the graph level in the attributes element. +Plural version of viz attributes: `viz:colors`, `viz:sizes`, `viz:shapes`, `viz:positions`, `viz:thicknesses` are used to host the dynamic definitions of viz attributes. + +\paragraph{} +We propose to include those into the the attribute(s) definitions in order to: +\begin{itemize} +\item Set the rule globally for the graph +\item Reuse the node/edge class attribute already set in the attributes +\item Nest the scale definition inside the corresponding attribute definition +\end{itemize} + +\paragraph{} +To represent the dynamic definitions of viz attributes we need to define: +\begin{itemize} +\item which attribute to use: nested in attribute definition... +\item the scale type: quantitative, qualitative, layout... +\item the parameters: color hashmap, range, spline method... +\end{itemize} + +A GEXF can host more than one for one viz parameter. For instance colors could be derived from two different node attributes type and degree. Therefore a \textit{defaultscales} element can be used to specify which scale has been used to render the colors, sizes (...) in the gexf. + +The scale information are meant to be used to draw a legend. But they can also theoretically be used to generate the according viz parameters. +Yet a GEXF file can contain both viz attributes at the node/edge levels (local) and a viz scale at the graph level (global). +The local viz attributes must take over global definition when rendering visually a GEXF. +To ensure the best GEXF compatibility among existing consumers we recommend to set both local and global systematically. + +\paragraph{Scale Example} + +The following gexf contains an gexf attributes section which embed colors, sizes and positions legend information. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={VIZ Scales},label=vizscales] + +... + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +... + +\end{lstlisting} + +\paragraph{Qualitative color scale} The \textit{viz:colors} describe a \textit{qualitative} scale which uses the \textit{modularityclass} node attribute to define the node's \textit{viz:color} attribute. +To do so the \textit{viz:colors} element contains a color palette attributing a color for each value. A \textit{viz:colordefault} can be used to handle null or not listed values. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Qualitative color scale},label=vizscalecolorquali] + + + 0 + + + + + + + + + +\end{lstlisting} + +\paragraph{Quantitative color scale} The \textit{viz:colors} can also describe a \textit{quantitative} scale which uses the \textit{degree} node attribute to define the node's \textit{viz:color} attribute. +To do so the \textit{viz:colors} element contains a color gradient definition defining color points on a 0-1 value scale. The \textit{scalelabel} attribute is useful to give more textual description of the scale logic. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Quantitative color scale},label=vizscalecolorquanti] + + + 0 + + + + + + + +\end{lstlisting} + +\paragraph{Concurrent color scales} There can be more than one \textit{viz:colors} in the node attributes. To inform which scale were used to compute the colors encoded in the GEXF, a \textit{viz:defaultscales} element nested inside \textit{attributes} indicates which is the default scale to be used. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Quantitative color scale},label=vizscalecolorquanti] + + + 0 + + + + + + + + + + 0 + + + + + + + + +\end{lstlisting} + +\paragraph{Quantitative size scale} For \textit{quantitative} scale, \textit{viz:scalepoint} elements can be used to define an transformation function to adapt node attributes values to the viz (size here) parameters. The function is expressed as a set of points which represents a [0-1] to [0-1] curve. Here the \textit{scalelabel} indicates that this set of points actually represent a square-root function. Although a set of discreet point is not as precise as a real function expression it has been preferred as function expression would have mean choosing a syntax and is more flexible than a finite set of function name. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Quantitative size scale},label=vizscalesizequanti] + + + 0 + + + + + + + + + + + + + + + + +\end{lstlisting} + +\paragraph{Positions layout} Nodes layouts are algorithms which are used to calculate (x,y) node positions. As they usually are not bind on one specific attribute the \textit{vis:positions} element is placed in the \textit{attributes} element. It documents which algorithm(s) has been used with an optional \textit{referenceURL}. The \textit{vis:layout} element contains a list of parameters which were used. Each \textit{vis:layout} must have a \textit{step} attribute which indicates in which order the layouts were applied. + +\lstset{ style=gexf } +\begin{lstlisting}[caption={Positions layout},label=vizpositionlayout] + + + 0 + + + + + + + + + + + + + +\end{lstlisting} + +\section{Advices: Parser optimization} \label{advices} + +This section provides some good tips to write parser-friendly files. +\begin{itemize} + \item Always place the edges after the nodes, as it is mandatory since version 1.2. Some parsers, depending on their implementation, may reject an edge if its linked nodes haven't been declared before, due to conceptual or data integrity reason. + \item Use the \textit{count} XML-attribute in \textit{nodes} and \textit{edges} declaration: the parser will know how much memory it should allocate, and will speed up the file reading. Note that count only refers to direct children, not the whole sub-graph! + \item Prefer \textit{liststring} to \textit{string} attributes if you can. A smart parser will store the strings in one place, and just set pointers to them from the related nodes/edges. + \item Identifiers may be interpreted as integers if you only use numbers. We encourage this practice, as an integer takes much less size in memory than an equivalent string. Tell the parser to optimize IDs storage by filling the optional graph XML-attribute called \textit{idtype} with \textit{string}, \textit{integer} or \textit{long}. +\end{itemize} + +\section{Web Services} \label{ws} + +The content-type for serving GEXF files via HTTP/REST is \textit{application/gexf+xml}. + +\section{Resources} \label{resources} + +Specifications are available on GitHub at \href{https://github.com/gephi/gexf/}{https://github.com/gephi/gexf/}. Contributions and feedback are welcome. + +\paragraph{} +The website \href{https://gexf.net}{https://gexf.net} contains additional examples and links to popular libraries capable of reading and writing the format. + +\section{Changelog} \label{changelog} + +Note that we used to use "draft" in certain version (e.g "1.2draft") up until 1.3 when we decided to simply use full versions numbers. + +\paragraph{} +The GEXF specification history: + +\subsection*{Version 1.3.1} + +\begin{itemize} +\item Added a title element in graph +\item Extend `viz` module to support legend drawing +\end{itemize} + +\subsection*{Version 1.3} + +\begin{itemize} +\item Add `kind` attribute on `edge` to support multi-graph (i.e. parallel edges) +\item The edge `weight` is now a `double` instead of a `float` +\item The edge `id` is now optional +\item Add `xsd:long`as possible `idtype` on `\` +\item Add new attribute types `bigdecimal`, `biginteger`, `char`, `short` and `byte` +\item Add new list attributes like `listboolean` or `listinteger` for each atomic type +\item Dynamics +\begin{itemize} +\item Add a `timezone` attribute on `\` to use as a timezone in case it's omitted in the element timestamps +\item Open intervals attributes `startopen` and `endopen` are removed. Use regular inclusive `start` and `end` instead +\item Remove `start` and `end` attributes on `\` as it was redundant with `\` attributes +\item Timestamp support +\begin{itemize} +\item Add the ability to represent time with single timestamps instead of intervals. We want feature parity between the two time representations but note they can't be mixed. +\item Add a `timerepresentation` enum in `\` with either `interval` (default) or `timestamp` to configure the way the time is represented +\item Add `timestamp` attribute to `\`, `\`, `\` and `\` to support this new time representation +\end{itemize} +\item Alternative to spell elements +\begin{itemize} +\item Add a `timestamps` attribute to `\` and `\` to represent a list of timestamps without having to use spells +\item Similarly, add a `intervals` attribute to `\` and `\` +\end{itemize} +\item New slice mode +\begin{itemize} +\item The optional `mode` attribute on `\` now has an additional `slice` value, in addition of `static` and `dynamic`. With slice, the expectation is that the `\` also has either a `timestamp` or `start` / `end` intervals. +\item Add a `timestamp` attribute on `\` to characterise the slice this graph represent +\item Change the meaning of the `start` and `end` attributes on `\` to either characterise the slide instead of the time bounds, which should rather be inferred +\end{itemize} +\end{itemize} +\item Viz +\begin{itemize} +\item Add `hex` attribute on `\` so it can support values like `#FF00FF` +\item The `z` position is no longer required +\item Dynamic attributes like `start`, `end` or child elements `\` are no longer supported for viz attributes. To represent viz attributes over time, an alternative is to create multiple graphs each representing a slice. +\end{itemize} +\end{itemize} + +\subsection*{Version 1.2} + +\begin{itemize} +\item The node and edge `label` attribute are now optional +\item \ should be placed before \ +\item Dynamics +\begin{itemize} +\item Rename the `timetype` attribute to `timeformat`. This attribute is set on `\` to specify how time information is encoded, either like a date or like a double +\item The `timeformat` is currently either `float` or `date` and default value is `date`. The `float` type is replaced by `double`, and is now the default value +\item Added `timeformat` types `integer` and `dateTime`. DateTime is equivalent to timestamps +\item Add open intervals (non-inclusive): `startopen` and `endopen` attributes +\item `\` and `\` are renamed `\` and `\` respectively because slices are a different concept as remarked +\end{itemize} +\item Viz +\begin{itemize} +\item Add viz attributes support for dynamics +\item Add the alpha channel to RGB. Colors are now encoded in RGBA. It is a float from 0.0 (invisible) to 1.0 (fully visible). If omitted, the default alpha-value is 1.0 (no transparency). +\end{itemize} +\end{itemize} + +\subsection*{Version 1.1} + +Modules are stabilized and new ones appear: hierarchy and phylogeny. + +\subsection*{Version 1.0} + +First specification. Basic topology, associated data and dynamics attempt constitute the core, plus a visualization extension. + +\printindex + +\end{document} diff --git a/primer/1.3.1/images.tex b/primer/1.3.1/images.tex new file mode 100755 index 0000000..820020b --- /dev/null +++ b/primer/1.3.1/images.tex @@ -0,0 +1,556 @@ +\batchmode +\documentclass[a4paper,10pt]{article} +\RequirePackage{ifthen} + + + + +\usepackage[utf8x]{inputenc} +\usepackage{makeidx} +\usepackage{verbatim} +\usepackage{listings} +\usepackage{color} +\usepackage{graphics} + + +\makeindex + + +\lstdefinestyle{xml}{ + language=XML, + xleftmargin=\parindent, + xrightmargin=\parindent, + aboveskip=3mm, + belowskip=3mm, + basicstyle=\footnotesize\ttfamily , + commentstyle=\small\rmfamily\em , + tabsize=2, + columns=[l]fullflexible, + showstringspaces=false, + keywordstyle=\color{blue}\bfseries , + stringstyle=\color{red}, + usekeywordsintag=false, + markfirstintag=true, + firstnumber=auto, + frame=shadowbox, + frameround=tttf +} + + +\title{GEXF 1.1draft Primer} +\author{Gephi project} + + + + + +\pagecolor[gray]{.7} + +\usepackage[]{inputenc} + + + +\makeatletter + +\makeatletter +\count@=\the\catcode`\_ \catcode`\_=8 +\newenvironment{tex2html_wrap}{}{}% +\catcode`\<=12\catcode`\_=\count@ +\newcommand{\providedcommand}[1]{\expandafter\providecommand\csname #1\endcsname}% +\newcommand{\renewedcommand}[1]{\expandafter\providecommand\csname #1\endcsname{}% + \expandafter\renewcommand\csname #1\endcsname}% +\newcommand{\newedenvironment}[1]{\newenvironment{#1}{}{}\renewenvironment{#1}}% +\let\newedcommand\renewedcommand +\let\renewedenvironment\newedenvironment +\makeatother +\let\mathon=$ +\let\mathoff=$ +\ifx\AtBeginDocument\undefined \newcommand{\AtBeginDocument}[1]{}\fi +\newbox\sizebox +\setlength{\hoffset}{0pt}\setlength{\voffset}{0pt} +\addtolength{\textheight}{\footskip}\setlength{\footskip}{0pt} +\addtolength{\textheight}{\topmargin}\setlength{\topmargin}{0pt} +\addtolength{\textheight}{\headheight}\setlength{\headheight}{0pt} +\addtolength{\textheight}{\headsep}\setlength{\headsep}{0pt} +\setlength{\textwidth}{349pt} +\newwrite\lthtmlwrite +\makeatletter +\let\realnormalsize=\normalsize +\global\topskip=2sp +\def\preveqno{}\let\real@float=\@float \let\realend@float=\end@float +\def\@float{\let\@savefreelist\@freelist\real@float} +\def\liih@math{\ifmmode$\else\bad@math\fi} +\def\end@float{\realend@float\global\let\@freelist\@savefreelist} +\let\real@dbflt=\@dbflt \let\end@dblfloat=\end@float +\let\@largefloatcheck=\relax +\let\if@boxedmulticols=\iftrue +\def\@dbflt{\let\@savefreelist\@freelist\real@dbflt} +\def\adjustnormalsize{\def\normalsize{\mathsurround=0pt \realnormalsize + \parindent=0pt\abovedisplayskip=0pt\belowdisplayskip=0pt}% + \def\phantompar{\csname par\endcsname}\normalsize}% +\def\lthtmltypeout#1{{\let\protect\string \immediate\write\lthtmlwrite{#1}}}% +\newcommand\lthtmlhboxmathA{\adjustnormalsize\setbox\sizebox=\hbox\bgroup\kern.05em }% +\newcommand\lthtmlhboxmathB{\adjustnormalsize\setbox\sizebox=\hbox to\hsize\bgroup\hfill }% +\newcommand\lthtmlvboxmathA{\adjustnormalsize\setbox\sizebox=\vbox\bgroup % + \let\ifinner=\iffalse \let\)\liih@math }% +\newcommand\lthtmlboxmathZ{\@next\next\@currlist{}{\def\next{\voidb@x}}% + \expandafter\box\next\egroup}% +\newcommand\lthtmlmathtype[1]{\gdef\lthtmlmathenv{#1}}% +\newcommand\lthtmllogmath{\dimen0\ht\sizebox \advance\dimen0\dp\sizebox + \ifdim\dimen0>.95\vsize + \lthtmltypeout{% +*** image for \lthtmlmathenv\space is too tall at \the\dimen0, reducing to .95 vsize ***}% + \ht\sizebox.95\vsize \dp\sizebox\z@ \fi + \lthtmltypeout{l2hSize % +:\lthtmlmathenv:\the\ht\sizebox::\the\dp\sizebox::\the\wd\sizebox.\preveqno}}% +\newcommand\lthtmlfigureA[1]{\let\@savefreelist\@freelist + \lthtmlmathtype{#1}\lthtmlvboxmathA}% +\newcommand\lthtmlpictureA{\bgroup\catcode`\_=8 \lthtmlpictureB}% +\newcommand\lthtmlpictureB[1]{\lthtmlmathtype{#1}\egroup + \let\@savefreelist\@freelist \lthtmlhboxmathB}% +\newcommand\lthtmlpictureZ[1]{\hfill\lthtmlfigureZ}% +\newcommand\lthtmlfigureZ{\lthtmlboxmathZ\lthtmllogmath\copy\sizebox + \global\let\@freelist\@savefreelist}% +\newcommand\lthtmldisplayA{\bgroup\catcode`\_=8 \lthtmldisplayAi}% +\newcommand\lthtmldisplayAi[1]{\lthtmlmathtype{#1}\egroup\lthtmlvboxmathA}% +\newcommand\lthtmldisplayB[1]{\edef\preveqno{(\theequation)}% + \lthtmldisplayA{#1}\let\@eqnnum\relax}% +\newcommand\lthtmldisplayZ{\lthtmlboxmathZ\lthtmllogmath\lthtmlsetmath}% +\newcommand\lthtmlinlinemathA{\bgroup\catcode`\_=8 \lthtmlinlinemathB} +\newcommand\lthtmlinlinemathB[1]{\lthtmlmathtype{#1}\egroup\lthtmlhboxmathA + \vrule height1.5ex width0pt }% +\newcommand\lthtmlinlineA{\bgroup\catcode`\_=8 \lthtmlinlineB}% +\newcommand\lthtmlinlineB[1]{\lthtmlmathtype{#1}\egroup\lthtmlhboxmathA}% +\newcommand\lthtmlinlineZ{\egroup\expandafter\ifdim\dp\sizebox>0pt % + \expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetinline} +\newcommand\lthtmlinlinemathZ{\egroup\expandafter\ifdim\dp\sizebox>0pt % + \expandafter\centerinlinemath\fi\lthtmllogmath\lthtmlsetmath} +\newcommand\lthtmlindisplaymathZ{\egroup % + \centerinlinemath\lthtmllogmath\lthtmlsetmath} +\def\lthtmlsetinline{\hbox{\vrule width.1em \vtop{\vbox{% + \kern.1em\copy\sizebox}\ifdim\dp\sizebox>0pt\kern.1em\else\kern.3pt\fi + \ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}} +\def\lthtmlsetmath{\hbox{\vrule width.1em\kern-.05em\vtop{\vbox{% + \kern.1em\kern0.8 pt\hbox{\hglue.17em\copy\sizebox\hglue0.8 pt}}\kern.3pt% + \ifdim\dp\sizebox>0pt\kern.1em\fi \kern0.8 pt% + \ifdim\hsize>\wd\sizebox \hrule depth1pt\fi}}} +\def\centerinlinemath{% + \dimen1=\ifdim\ht\sizebox<\dp\sizebox \dp\sizebox\else\ht\sizebox\fi + \advance\dimen1by.5pt \vrule width0pt height\dimen1 depth\dimen1 + \dp\sizebox=\dimen1\ht\sizebox=\dimen1\relax} + +\def\lthtmlcheckvsize{\ifdim\ht\sizebox<\vsize + \ifdim\wd\sizebox<\hsize\expandafter\hfill\fi \expandafter\vfill + \else\expandafter\vss\fi}% +\providecommand{\selectlanguage}[1]{}% +\makeatletter \tracingstats = 1 + + +\begin{document} +\pagestyle{empty}\thispagestyle{empty}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength hsize=\the\hsize}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength vsize=\the\vsize}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength hoffset=\the\hoffset}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength voffset=\the\voffset}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength topmargin=\the\topmargin}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength topskip=\the\topskip}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength headheight=\the\headheight}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength headsep=\the\headsep}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength parskip=\the\parskip}\lthtmltypeout{}% +\lthtmltypeout{latex2htmlLength oddsidemargin=\the\oddsidemargin}\lthtmltypeout{}% +\makeatletter +\if@twoside\lthtmltypeout{latex2htmlLength evensidemargin=\the\evensidemargin}% +\else\lthtmltypeout{latex2htmlLength evensidemargin=\the\oddsidemargin}\fi% +\lthtmltypeout{}% +\makeatother +\setcounter{page}{1} +\onecolumn + +% !!! IMAGES START HERE !!! + +\stepcounter{section} +\stepcounter{section} +\stepcounter{subsection} +{\newpage\clearpage +\lthtmlfigureA{lstlisting21}% +\begin{lstlisting}[caption={Hello world!},label=helloworld] +\par + + + Gephi.org + A hello world! file + + + + + + + + + + + +\end{lstlisting}% +\lthtmlfigureZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline264}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline266}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline268}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline270}% +$\mathord{-}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline272}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline274}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline276}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline278}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline280}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline282}% +$\mathord{-}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline284}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline286}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline288}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline290}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline292}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline294}% +$\mathord{-}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline296}% +$\mathord{-}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline298}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline300}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline302}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline304}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline306}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline308}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline310}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline312}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline314}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline316}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline318}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline320}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline322}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline324}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline326}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline328}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline330}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline332}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline334}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline336}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline338}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline340}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline342}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline344}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline346}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline348}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline350}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline352}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline354}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline356}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline358}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline360}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline362}% +$\mathord{=}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline364}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline366}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline368}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline370}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline372}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline374}% +$\mathord{<}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +{\newpage\clearpage +\lthtmlinlinemathA{tex2html_wrap_inline376}% +$\mathord{>}$% +\lthtmlinlinemathZ +\lthtmlcheckvsize\clearpage} + +\stepcounter{subsection} +\stepcounter{subsection} +\stepcounter{subsubsection} +\stepcounter{subsubsection} +\stepcounter{subsubsection} +\stepcounter{subsection} +\stepcounter{subsubsection} +\stepcounter{subsubsection} +\stepcounter{subsubsection} +\stepcounter{section} +\stepcounter{subsection} +\stepcounter{section} +\stepcounter{section} +\stepcounter{subsection} + +\end{document} diff --git a/primer/1.3.1/pdf.sh b/primer/1.3.1/pdf.sh new file mode 100755 index 0000000..f7705a9 --- /dev/null +++ b/primer/1.3.1/pdf.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +prefix=gexf-131-primer + +# Compile +./compile.sh + +# PDF +pdflatex -interaction=nonstopmode $prefix.tex + +#acroread $prefix.pdf & diff --git a/primer/1.3.1/res/hierarchy.png b/primer/1.3.1/res/hierarchy.png new file mode 100755 index 0000000..4cfb95c Binary files /dev/null and b/primer/1.3.1/res/hierarchy.png differ diff --git a/primer/1.3.1/res/simple.png b/primer/1.3.1/res/simple.png new file mode 100755 index 0000000..4af6566 Binary files /dev/null and b/primer/1.3.1/res/simple.png differ diff --git a/primer/1.3.1/simple.gexf b/primer/1.3.1/simple.gexf new file mode 100755 index 0000000..b4f289d --- /dev/null +++ b/primer/1.3.1/simple.gexf @@ -0,0 +1,21 @@ + + + + Gephi.org + A hello world! file + + + + + + + + + + + diff --git a/primer/1.3.1/simple.gexf.tex b/primer/1.3.1/simple.gexf.tex new file mode 100755 index 0000000..40dbf14 --- /dev/null +++ b/primer/1.3.1/simple.gexf.tex @@ -0,0 +1,30 @@ +% Document title: simple.gexf + +\input highlight.sty + +{ +\tt +{\hlstd }{\hlkwa $\mathord{<}$?xml version$\mathord{=}$}{\hlstr "1.0"}{\hlkwa encoding$\mathord{=}$}{\hlstr "UTF$\mathord{-}$8"}{\hlkwa ?$\mathord{>}$}{\hlstd }\leavevmode\par +{\hlkwa $\mathord{<}$gexf xmlns$\mathord{=}$}{\hlstr "http://www.gexf.net/1.1draft"}{\hlkwa }\leavevmode\par +{\hlstd xmlns:viz$\mathord{=}$}{\hlstr "http://www.gexf.net/1.1draft/viz"}{\hlstd \leavevmode\par + xmlns:xsi$\mathord{=}$}{\hlstr "http://www.w3.org/2001/XMLSchema$\mathord{-}$instance"}{\hlstd \leavevmode\par + xsi:schemaLocation$\mathord{=}$}{\hlstr "http://www.gexf.net/1.1draft}\leavevmode\par +{\hlstr }{\hlstd\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }{\hlstr http://www.gexf.net/1.1draft/gexf.xsd"}{\hlstd \leavevmode\par + version$\mathord{=}$}{\hlstr "1.1"}{\hlstd $\mathord{>}$\leavevmode\par +}{\hlstd\ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$meta lastmodifieddate$\mathord{=}$}{\hlstr "2009$\mathord{-}$03$\mathord{-}$20"}{\hlkwa $\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$creator$\mathord{>}$}{\hlstd Gephi.org}{\hlkwa $\mathord{<}$/creator$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$description$\mathord{>}$}{\hlstd A hello world! file}{\hlkwa $\mathord{<}$/description$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$/meta$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$graph mode$\mathord{=}$}{\hlstr "static"}{\hlkwa defaultedgetype$\mathord{=}$}{\hlstr "simple"}{\hlkwa $\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$nodes$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$node id$\mathord{=}$}{\hlstr "0"}{\hlkwa label$\mathord{=}$}{\hlstr "Hello"}{\hlkwa /$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$node id$\mathord{=}$}{\hlstr "1"}{\hlkwa label$\mathord{=}$}{\hlstr "Word"}{\hlkwa /$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$/nodes$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$edges$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$edge id$\mathord{=}$}{\hlstr "0"}{\hlkwa source$\mathord{=}$}{\hlstr "0"}{\hlkwa target$\mathord{=}$}{\hlstr "1"}{\hlkwa /$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ \ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$/edges$\mathord{>}$}{\hlstd \leavevmode\par +}{\hlstd\ \ \ \ }{\hlstd }{\hlkwa $\mathord{<}$/graph$\mathord{>}$}{\hlstd }\leavevmode\par +{\hlkwa $\mathord{<}$/gexf$\mathord{>}$}{\hlstd }\leavevmode\par +} +\bye +% TeX generated by Highlight 2.4.8, http://www.andre-simon.de/ diff --git a/primer/1.3.1/sty/fancy-listings.sty b/primer/1.3.1/sty/fancy-listings.sty new file mode 100755 index 0000000..d64b29b --- /dev/null +++ b/primer/1.3.1/sty/fancy-listings.sty @@ -0,0 +1,132 @@ +\newcommand{\as}{\ensuremath{\rightarrow}} +\newcommand{\variable}[1]{\texttt{#1}} +\newcommand{\keyword}[1]{\texttt{\textbf{#1}}} +\newcommand{\function}[1]{\textsf{#1}} +\newcommand{\element}[1]{\textsf{#1}} + +\RequirePackage{fancyvrb} +\RequirePackage{color} + \definecolor{lightblue}{rgb}{.3,.5,1} + \definecolor{orange}{rgb}{1,.7,0} + \definecolor{darkorange}{rgb}{1,.4,0} + \definecolor{darkgreen}{rgb}{0,.4,0} + \definecolor{darkblue}{rgb}{0,0,.4} + \definecolor{darkred}{rgb}{.56,0,0} + \definecolor{gray}{rgb}{.3,.3,.3} + \definecolor{darkgray}{rgb}{.2,.2,.2} + \definecolor{shadecolor}{gray}{0.925} + +\RequirePackage{listings} +\lstdefinelanguage{Xcerpt}{% + morekeywords=[1]{GOAL,CONSTRUCT,FROM,END,DECLARE,PROGRAM},% blocks + morekeywords=[2]{declare,all,some,position,pos,optional,opt,where,order-by,group-by,and,or,not},% + morekeywords=[2]{variable,ns-default,ns-prefix,not,if,then,else,case,without,desc,descendant,in,identity},% + morekeywords=[3]{idvar,var,->,as},% variables + morekeywords=[4]{lexical,sum,count,join},% aggregation/sorting + morekeywords=[5]{},% regexps (s.moredelim below) + morestring=[b]",% + morecomment=[l]{\#},% + morecomment=[s]{\\\#}{\#\\\\)},% + alsodigit={-},% + literate= {->}{$\rightarrow$}{2},% + sensitive% + }[keywords,strings] + + \lstdefinelanguage{CXcerpt}{% + morekeywords=[1]{GOAL,CONSTRUCT,FROM,END,DECLARE,PROGRAM},% blocks + morekeywords=[2]{declare,all,some,position,pos,optional,opt,where,order-by,group-by,and,or,not},% + morekeywords=[2]{variable,ns-default,ns-prefix,not,if,then,else,case,without,desc,descendant,identity},% + morekeywords=[3]{var,->,as},% variables + morekeywords=[4]{lexical,sum,count,join},% aggregation/sorting + morekeywords=[5]{},% regexps (s.moredelim below) + morestring=[b]",% + morecomment=[l]{\#},% + morecomment=[s]{\\\#}{\#\\\\)},% + morecomment=[s]{},% + alsodigit={-},% + literate= {->}{$\rightarrow$}{2},% + sensitive% + }[keywords,strings] + + \lstdefinelanguage{XQuery}{% + morekeywords=[1]{for,in,let,where,return,if,then,else,case,default,typeswitch},% + morekeywords=[1]{child,descendant,attribute,self,descendant-or-self,following-sibling,following,parent,ancestor,preceding-sibling,preceding,ancestor-or-self,},% + morekeywords=[2]{cast,as,castable,instance,of,some,every,in,satisfies,unordered,ordered,stable,order,by,descending,empty,collation,derives-from,nilled,nillable,node,schema-element,document-node},% + morekeywords=[3]{element,function,variable,comment,processing-instruction,text,document,attribute,to},% + morekeywords=[4]{xquery,declare,namespace,module,option,ordering,version,encoding,order,last,copy-namespaces,preserve,no-inherit,import,schema,at,external,construction,strip,base-uri,boundary-space},% + morekeywords=[3]{fn:count,fn:sum,fn:empty,fn:max,fn:doc,fn:avg,fn:node-name,fn:last,fn:position,fn:error,position,last,size,count,substring,fn:substring,string,fn:string,contains,fn:contains,concat,fn:concat},% + morekeywords=[5]{mod,eq,or,and,idiv,true,false,is,div,union,intersect,except,gt,lt,},% + morestring=[b]",% + morecomment=[s]{(:}{:)},% + sensitive% + }[keywords,comments,strings] + + \lstdefinelanguage{RNC}{% + morekeywords=[1]{start,element,attribute,text,empty},% blocks + morekeywords=[2]{default,namespace},% + morekeywords=[4]{grammar,include,parent},% + morekeywords=[3]{},% aggregation/sorting + morekeywords=[5]{},% regexps (s.moredelim below) + morestring=[b]",% + morecomment=[l]{\#},% + alsodigit={-},% + sensitive% + }[keywords,comments,strings] + + \lstdefinelanguage{N3}{% + morekeywords=[1]{@prefix},% + morestring=[b]",% + %morecomment=[s]{(:}{:)},% + sensitive% + }[keywords,comments,strings] + + \lstdefinelanguage{DAPLEX}{% + morekeywords=[1]{FOR,EACH,SUCH,THAT,FOR,SOME,AND,PRINT},% + morestring=[b]",% + %morecomment=[s]{(:}{:)},% + sensitive% + }[keywords,strings] + + + \lstdefinelanguage{XMLXcerpt}[]{XML}% + {morekeywords={goal,rule,data,construct,from,out,xc:goal,xc:rule,xc:data,xc:construct,xc:from,variable,without,except,optional,all,some,first,% + order-by,group-by,with-default,condition,arithmetic-expression,% + comparison-expression,and,or,not,declare,ns-prefix,ns-default,% + iri,name,% + xc:variable,xc:without,xc:except,xc:optional,xc:all,xc:some,xc:first,% + xc:order-by,xc:group-by,xc:with-default,xc:condition,xc:arithmetic-expression,% + xc::comparison-expression,xc:and,xc:or,xc:not,xc:declare,xc:ns-prefix,xc:ns-default,% + xc:iri,xc:name,% + children,attributes,label,element,identifier,ordered,total,attribute,value,name,wildcard,min,max,order-relation,equivalence-relation,operator,comment,reference,text},% + % morekeywords=[3]{xc:value},% + alsodigit={-},% + }% + + + \lstset{% + basicstyle = \ttfamily,% + keywordstyle = [1]\bfseries,% + keywordstyle = [2]\bfseries,% + keywordstyle = [3]\itshape,% + keywordstyle = [4]\bfseries,% + keywordstyle = [5]\bfseries,% + stringstyle = \sffamily\color{darkgreen},% + commentstyle = \sffamily\color{darkgray},% + showstringspaces= false,% + fancyvrb = true,% + firstnumber=auto,% +% frame=tb,% + breaklines=true,breakatwhitespace=true,% +% prebreak=\textellipsis,postbreak=\textellipsis,% + emphstyle=\color{red}\underbar, emphstyle={[2]\color{blue}\underbar},% + numbers=right, numberstyle=\tiny, stepnumber=2, numbersep=5pt,% + extendedchars=true,inputencoding=utf8,% + backgroundcolor=\color{shadecolor}, + xleftmargin=10pt, + xrightmargin=10pt, + language=Xcerpt% + } + + \lstset{columns={[c]fullflexible}}% + +\lstdefinestyle{xml}{keywordstyle = \color{blue}} diff --git a/primer/1.3.1/sty/gexf.sty b/primer/1.3.1/sty/gexf.sty new file mode 100755 index 0000000..cb2117f --- /dev/null +++ b/primer/1.3.1/sty/gexf.sty @@ -0,0 +1,33 @@ +\lstdefinelanguage{GEXF}{ + morekeywords=[0]{gexf, meta, graph, creator, description, nodes, edges, node, edge, attributes, attribute, options, attvalues, attvalue, default, keywords, color, size, position, shape, thickness, parents, parent, spells, spell, viz}, + morekeywords=[1]{id, for, pid, label, source, target, mode, defaultedgetype, type, lastmodifieddate, start, startopen, end, endopen, timetype, cardinal, class, count, title, value, r, g, b, x, y, z, a, xmlns}, + morekeywords=[2]{simple, double, static, dynamic, integer, double, float, boolean, liststring, string, date, anyURI}, + morestring=[b]", +} + +\lstdefinestyle{gexf}{ + language=GEXF, + xleftmargin=\parindent, + xrightmargin=\parindent, + aboveskip=3mm, + belowskip=3mm, + tabsize=2, + columns=[l]fullflexible, + showstringspaces=false, + % text styles + basicstyle=\scriptsize\ttfamily, + commentstyle=\footnotesize\rmfamily\em, + stringstyle=\rmfamily\em\color{gray}, + keywordstyle=[0]\color{blue}, + keywordstyle=[1]\color{darkorange}, + keywordstyle=[2]\underbar, + % numbers + numbers=left, + numberstyle=\tiny, + stepnumber=3, + firstnumber=1, + % decoration + frame=shadowbox, + frameround=tttf + %backgroundcolor=\color{shadecolor} +} diff --git a/primer/1.3.1/sty/highlight.sty b/primer/1.3.1/sty/highlight.sty new file mode 100755 index 0000000..4746197 --- /dev/null +++ b/primer/1.3.1/sty/highlight.sty @@ -0,0 +1,23 @@ +% Style definition file generated by highlight 2.4.8, http://www.andre-simon.de/ + +% Highlighting theme definition: + +\def\hlstd{\textColor{1 1 1 0.0}} +\def\hlnum{\textColor{0.84 0.84 0 0.0}} +\def\hlesc{\textColor{0 1 0 0.0}} +\def\hlstr{\textColor{0 1 1 0.0}} +\def\hldstr{\textColor{0.49 0.49 1 0.0}} +\def\hlslc{\it\textColor{0.49 0.49 0.49 0.0}} +\def\hlcom{\it\textColor{0.49 0.49 0.49 0.0}} +\def\hldir{\textColor{1 0.49 1 0.0}} +\def\hlline{\textColor{0.67 0.67 0.67 0.0}} +\def\hlsym{\textColor{1 1 1 0.0}} +\def\hlkwa{\bf\textColor{1 1 1 0.0}} +\def\hlkwb{\textColor{0.49 1 1 0.0}} +\def\hlkwc{\bf\textColor{1 1 1 0.0}} +\def\hlkwd{\textColor{1 1 0.49 0.0}} +% The special option is not supported by all dvi drivers +\special{background rgb 1 1 1} +\nopagenumbers +\input colordvi + diff --git a/primer/1.3.1/sty/rnc.sty b/primer/1.3.1/sty/rnc.sty new file mode 100755 index 0000000..9ba59b5 --- /dev/null +++ b/primer/1.3.1/sty/rnc.sty @@ -0,0 +1,24 @@ +\lstdefinelanguage{RNC}{ + morekeywords=[1]{start,element,attribute,text,empty,string,text}, + morekeywords=[2]{default,namespace,datatypes}, + morekeywords=[3]{grammar,include,parent,inherit}, + morekeywords=[4]{xsd}, + morekeywords=[5]{defaultValue}, + morestring=[b]", + morecomment=[l]{\#}, + alsodigit={-}, + sensitive +} + + +\lstdefinestyle{rnc}{ + language=RNC, + basicstyle=\scriptsize\ttfamily, + commentstyle=\footnotesize\sffamily\em\color{darkgreen}, + stringstyle=\sffamily\color{red}, + keywordstyle=[1]\color{blue}\bfseries, + keywordstyle=[2]\color{lightblue}\bfseries, + keywordstyle=[3]\color{lightblue}\bfseries, + keywordstyle=[4]\color{darkgreen}\bfseries, + keywordstyle=[5]\color{orange}\bfseries +} diff --git a/primer/1.3.1/sty/xml.sty b/primer/1.3.1/sty/xml.sty new file mode 100755 index 0000000..a6535b8 --- /dev/null +++ b/primer/1.3.1/sty/xml.sty @@ -0,0 +1,26 @@ +\lstdefinestyle{xml}{ + language=XML, + xleftmargin=\parindent, + xrightmargin=\parindent, + aboveskip=3mm, + belowskip=3mm, + basicstyle=\footnotesize\ttfamily, + commentstyle=\small\rmfamily\em, + tabsize=2, + columns=[l]fullflexible, + showstringspaces=false, + % keywords + keywordstyle=\color{blue}\bfseries, + stringstyle=\color{red}, + usekeywordsintag=false, + markfirstintag=true, + % numbers + numbers=left, + numberstyle=\tiny, + stepnumber=3, + firstnumber=1, + % decoration + frame=shadowbox, + frameround=tttf, + backgroundcolor=\color{shadecolor} +} diff --git a/primer/1.3.1/xhtml.sh b/primer/1.3.1/xhtml.sh new file mode 100755 index 0000000..2192df8 --- /dev/null +++ b/primer/1.3.1/xhtml.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +#if !( [[ -f $1 ]] ) then +# echo "usage: latex2xhtml source.tex" +# exit 1 +#fi + +#tex=$1 +#prefix=${tex%.tex} +prefix=gexf-13-primer + +# convert latex to html4 +latex2html -no_reuse -strict -split 0 -show_section_numbers -html_version 4.0,latin1,unicode -no_footnode -numbered_footnotes -address 0 -info 0 -no_navigation -iso_lang "EN.US" -no_auto_link -link 0 -style W3C-REC.css -image_type png $1 # -no_subdir + +# transform html4 to xhtml 1.0 +tidy --clean y --doctype "transitional" --output-xhtml y --indent "auto" --wrap "90" --char-encoding "utf8" $prefix.html > $prefix.xhtml + +# clean tmp file +rm $prefix.html +mv $prefix.xhtml $prefix.html + +# open browser +firefox $prefix.html & diff --git a/primer/README.md b/primer/README.md new file mode 100644 index 0000000..40a4094 --- /dev/null +++ b/primer/README.md @@ -0,0 +1,10 @@ +## requirements + +To compile the primer you need LaTeX tools. +One way to install it is to use the [texlive](https://www.tug.org/texlive/). + +On a ubuntu flavoured system install packages both texlive and texlive-latex-extra : + +``` +sudo apt-get install texlive texlive-latex-extra +``` diff --git a/specs/1.3.1/README.md b/specs/1.3.1/README.md new file mode 100644 index 0000000..12a3a43 --- /dev/null +++ b/specs/1.3.1/README.md @@ -0,0 +1,179 @@ +# GEXF 1.3.1 + +## Legend + +As discussed in [1.3 PR](https://github.com/gephi/gexf/pull/13#issuecomment-1010269442) we propose to extend GEXF to include the required information to embed the data which traces which data attribute were used to generate the viz variables. + +Such an extension would allow to draw a legend when rendering the graph. + +### The problem + +For now the nodes/edges viz attributes are stored as static data. This means that we don't why the viz:color has been set to this particular value. It's as if the color has been chosen by hand without any data logic. But very often those viz attributes are actually computed from data attributes using for instance the Partition/Ranking features in Gephi. +In such cases we cant to be able to inform the user when visualizing the graph that the color "red" represent the partition "x" by drawing a legend. + +### Proposition 1: viz attributes as data attribute function + +Ideally we would like to know the exact way which was used to render such viz attributes. +Viz attributes can be computed from attributes (globally set) or set manually (locally set). + +We propose to keep the existing way (1.3) to set viz attributes at the node/edge level to cover the manually set (locally set) use case. + +To cover the cases where the viz atts were computed we need to add the specifications which indicates the computation specs. We propose to set this at the data attributes definition level (globally). + +#### viz attributes set locally + +we propose to keep the viz attributes as they exist. First to ensure retro-compatibility and second because it's a good way to cover cases where viz attributes are set arbitrary by hand. As stated later we propose those local attributes takes over if set concurrently with global specs. + +#### viz attributes set globally + +We propose to create plural version of viz attributes: `viz:colors`, `viz:sizes`, `viz:positions`, `viz:thicknesses`. +Those tag will host the dynamic definitions of viz attributes. + +We propose to include those into the the attribute(s) definitions in order to: + +- set the rule globally for the graph +- reuse the node/edge class attribute already set in the attributes +- nest the scale definition inside the corresponding attribute definition + +To represent the dynamic definitions of viz attributes we need to define: + +- which attribute to use +- the method: partition, ranking, layout... +- the parameters: color hashmap, domain, spline method... + +Finally this specification allows to have more than one scale for one viz parameter set in the same gexf file. For instance colors could be derived from two different node attributes type and degree. So we add a defaultscales element to specify which scale has been used to render the colors, sizes (...) in the gexf. + +##### viz-colors + +**Set by a partition** + +```xml + + + 0 + + + + + + +``` + +**Set by a ranking** + +```xml + + + 0 + + + + + + + + +``` + +**Two colors scales** + +```xml + + + 0 + + + + + + + 0 + + + + + + + + + +``` + +##### viz-shapes + +```xml + + + person + + + + + + +``` + +##### viz-sizes + +```xml + + + 0 + + + + + + + + + + + + + + + + +``` + +##### viz-thicknesses + +```xml + + + 1 + + + + + +``` + +##### viz-positions + +**Positions set by a layout** + +Since positions layout does not depend on specific attribute we nest it in the attributes element. + +```xml + + + 0 + + + + + + +``` + +#### local takes over global + +In this proposition there is two ways to set the viz attributes: globally or locally. + +A GEXF file can contain both definitions for the same graph. + +We propose that implementations reading GEXF must use locally set viz attributes in priority if global rule are also indicated. + +To ensure the best GEXF compatibility among existing consumers we recommend to set both systematically. diff --git a/specs/1.3.1/_viz.rnc b/specs/1.3.1/_viz.rnc new file mode 100644 index 0000000..c16a57b --- /dev/null +++ b/specs/1.3.1/_viz.rnc @@ -0,0 +1,179 @@ +default namespace = inherit +namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" +namespace rng = "http://relaxng.org/ns/structure/1.0" +datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" + + +# Extends node +node-content &= + element color { color-content }? + & element position { position-content }? + & element size { size-content }? + & element shape { node-shape-content }? + +# Extend edge +edge-content &= + element color { color-content }? + & element thickness { thickness-content }? + & element shape { edge-shape-content }? + +# Color +color-content = + ((attribute r { color-channel } + & attribute g { color-channel } + & attribute b { color-channel }) + | attribute hex { xsd:token }) + & attribute a { alpha-channel }? + +# Position +position-content = + attribute x { xsd:float } + & attribute y { xsd:float } + & attribute z { xsd:float }? + +# Size +size-content = + attribute value { size-type } + +# Thickness +thickness-content = + attribute value { thickness-type } + +# Node shape +node-shape-content = + attribute value { node-shape-type } + & attribute uri { xsd:anyURI }? + +# Edge shape +edge-shape-content = + attribute value { edge-shape-type } + +# Color +color-channel = + xsd:nonNegativeInteger { maxInclusive = "255" } + +# Alpha Channel +alpha-channel = [ a:defaultValue = "1.0" ] + xsd:float { minInclusive = "0.0" maxInclusive = "1.0" } + +# Size +size-type = [ a:defaultValue = "1.0" ] + xsd:float { minInclusive = "0.0"} + +# Thickness +thickness-type = [ a:defaultValue = "1.0" ] + xsd:float { minInclusive = "0.0"} + +# Node shape +node-shape-type = [ a:defaultValue = "disc" ] + string "disc" | + string "square" | + string "triangle" | + string "diamond" | + string "image" + +# Edge shape +edge-shape-type = [ a:defaultValue = "solid" ] + string "solid" | + string "dotted" | + string "dashed" | + string "double" + +# Scales specs + +## common attributes +scale-label-attribute = attribute scalelabel {xsd:string} +for-value-attribute = attribute forvalue {xsd:string} +for-ratio-attribute = attribute forratio {xsd:float { minInclusive = "0" maxInclusive = "1.0" }} + +## colors scale content +colors-content = attribute scale { "quantitative" | "qualitative" } + & scale-label-attribute? + & element color { + color-content + & for-value-attribute? + & for-ratio-attribute? + }* + & element colordefault { + color-content + } + +## shapes scale content +shapes-content = scale-label-attribute? + & attribute scale {"qualitative"} + & element shape { + (node-shape-content | edge-shape-content) + & for-value-attribute + }* + & element shapedefault { + node-shape-content | edge-shape-content} + +## quantitative scale content + +control-point-type = xsd:float { minInclusive = "0" maxInclusive = "1.0" } + +control-point-content = attribute x {control-point-type} + & attribute y {control-point-type} + +sizes-scale-content = scale-label-attribute? + & attribute scale {"quantitative"} + & element transform { + (element pow { attribute exponent {xsd:integer}}| + element sqrt {empty}| + element log {empty}| + element log10 {empty}| + element exp {empty}| + element exp10 {empty}| + element spline { + element origin-control-point { + control-point-content + }, + element destination-control-point { + control-point-content + } + }) + } + & element range { + attribute min { size-type }, + attribute max { size-type }, + attribute default { size-type } + } +thicknesses-scale-content = scale-label-attribute? + & attribute scale {"quantitative"} + & element scalepoint { + for-ratio-attribute + & attribute factor {xsd:float} + }* + & element range { + attribute min { thickness-type }, + attribute max { thickness-type }, + attribute default { thickness-type } + } + +## layout +layout = element layout { + attribute algorithm { xsd:string }, + attribute step {xsd:positiveInteger}, + attribute referenceURL { xsd:anyURI}?, + element param { + attribute name { xsd:string }, + attribute type { attrtype-type}, + attribute value { xsd:string } + }* +} + +# Extends attribute with scales +attribute-content &= element colors {colors-content}? + & element shapes {shapes-content}? + & element sizes {sizes-scale-content}? + & element thicknesses {thicknesses-scale-content}? + +# Extends attributes with positions and defaultscales +attributes-content &= element positions { layout+}? + & element defaultscales { + attribute colors { id-type}?, + attribute sizes { id-type}?, + attribute shapes { id-type}?, + attribute thicknesses { id-type}? + }? + diff --git a/specs/1.3.1/_viz.rng b/specs/1.3.1/_viz.rng new file mode 100644 index 0000000..b56d7ba --- /dev/null +++ b/specs/1.3.1/_viz.rng @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 255 + + + + + + 0.0 + 1.0 + + + + + + 0.0 + + + + + + 0.0 + + + + + + disc + square + triangle + diamond + image + + + + + + solid + dotted + dashed + double + + + + + common attributes + + + + + + + + + + + + + 0 + 1.0 + + + + + colors scale content + + + + quantitative + qualitative + + + + + + + + + + + + + + + + + + + + + + + + + shapes scale content + + + + + + qualitative + + + + + + + + + + + + + + + + + + + + + + quantitative scale content + + 0 + 1.0 + + + + + + + + + + + + + + + + + + + quantitative + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + quantitative + + + + + + + + + + + + + + + + + + + + + + + + + + layout + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/specs/1.3.1/_viz.xsd b/specs/1.3.1/_viz.xsd new file mode 100644 index 0000000..c6d3fba --- /dev/null +++ b/specs/1.3.1/_viz.xsd @@ -0,0 +1,389 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + common attributes + + + + + + + + + + + + + + + + + + + colors scale content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + shapes scale content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + quantitative scale content + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/specs/1.3.1/common.rnc b/specs/1.3.1/common.rnc new file mode 100644 index 0000000..7506014 --- /dev/null +++ b/specs/1.3.1/common.rnc @@ -0,0 +1,34 @@ +id-type = + xsd:string | xsd:integer | xsd:long + + +# Attribute types +attrtype-type = + string "integer" | + string "long" | + string "double" | + string "float" | + string "boolean" | + string "bigdecimal" | + string "biginteger" | + string "byte" | + string "char" | + string "short" | + string "liststring" | + string "listboolean" | + string "listinteger" | + string "listlong" | + string "listfloat" | + string "listdouble" | + string "listbyte" | + string "listshort" | + string "listbigdecimal" | + string "listbiginteger" | + string "listchar" | + string "string" | + string "anyURI" + +# Attribute class (for attributes) +class-type = + string "node" | + string "edge" diff --git a/specs/1.3.1/common.rng b/specs/1.3.1/common.rng new file mode 100644 index 0000000..d459935 --- /dev/null +++ b/specs/1.3.1/common.rng @@ -0,0 +1,45 @@ + + + + + + + + + + + + + integer + long + double + float + boolean + bigdecimal + biginteger + byte + char + short + liststring + listboolean + listinteger + listlong + listfloat + listdouble + listbyte + listshort + listbigdecimal + listbiginteger + listchar + string + anyURI + + + + + + node + edge + + + diff --git a/specs/1.3.1/common.xsd b/specs/1.3.1/common.xsd new file mode 100644 index 0000000..508c29c --- /dev/null +++ b/specs/1.3.1/common.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/specs/1.3.1/dynamics.rnc b/specs/1.3.1/dynamics.rnc new file mode 100644 index 0000000..7b94468 --- /dev/null +++ b/specs/1.3.1/dynamics.rnc @@ -0,0 +1,83 @@ +default namespace = "http://gexf.net/1.3" +namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" +namespace rng = "http://relaxng.org/ns/structure/1.0" +datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" + +## Gext and data extension + +## Note: dynamic weight can be obtained by using the reserved title "weight" in attributes + +# Extends graph +graph-content &= + attribute timeformat { timeformat-type }? + & ((attribute start { time-type }? + & attribute end { time-type }?) + | attribute timestamp {time-type}) + & attribute mode { mode-type-graph }? + & attribute timerepresentation { timerepresentation-type }? + & attribute timezone { xsd:token }? + +# Extends attributes +attributes-content &= + attribute mode { mode-type-attributes }? + +# Extends attribute values +attvalue-content &= + ((attribute start { time-type }? + & attribute end { time-type }?) + | attribute timestamp {time-type}) + +# Extends node +node-content &= + (((attribute start { time-type }? + & attribute end { time-type }?) + | attribute intervals { xsd:token }) + | (attribute timestamp {time-type}) + | attribute timestamps { xsd:token }) + & element spells { spells-content }? + +# Extends edge +edge-content &= + (((attribute start { time-type }? + & attribute end { time-type }?) + | attribute intervals { xsd:token }) + | (attribute timestamp {time-type}) + | attribute timestamps { xsd:token }) + & element spells { spells-content }? + +# Spells +spells-content = + element spell { spell-content }+ + +# Spell +spell-content = + ((attribute start { time-type }? + & attribute end { time-type }?) + | attribute timestamp {time-type}) + + +# Time type +time-type = + xsd:integer | xsd:double | xsd:date | xsd:dateTime + +# Mode type (for graph) +mode-type-graph = [ a:defaultValue = "static" ] + string "static" | + string "dynamic" | + string "slice" + +# Mode type (for attributes) +mode-type-attributes = [ a:defaultValue = "static" ] + string "static" | + string "dynamic" + +# Time format type +timeformat-type = [ a:defaultValue = "double" ] + string "integer" | + string "double" | + string "date" | + string "dateTime" + +timerepresentation-type = [ a:defaultValue = "interval" ] + string "interval" | + string "timestamp" \ No newline at end of file diff --git a/specs/1.3.1/dynamics.rng b/specs/1.3.1/dynamics.rng new file mode 100644 index 0000000..8904240 --- /dev/null +++ b/specs/1.3.1/dynamics.rng @@ -0,0 +1,212 @@ + + + + + Gext and data extension + Note: dynamic weight can be obtained by using the reserved title "weight" in attributes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + static + dynamic + slice + + + + + + static + dynamic + + + + + + integer + double + date + dateTime + + + + + interval + timestamp + + + diff --git a/specs/1.3.1/dynamics.xsd b/specs/1.3.1/dynamics.xsd new file mode 100644 index 0000000..36a893c --- /dev/null +++ b/specs/1.3.1/dynamics.xsd @@ -0,0 +1,104 @@ + + + + + + Gext and data extension + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/specs/1.3.1/examples/viz-examples.gexf b/specs/1.3.1/examples/viz-examples.gexf new file mode 100644 index 0000000..c5dab4f --- /dev/null +++ b/specs/1.3.1/examples/viz-examples.gexf @@ -0,0 +1,114 @@ + + + + Legend examples + Gephi 0.9.3 + + + + + + + + + + + + 0 + + + + + + + + + 0 + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/specs/1.3.1/gexf.rnc b/specs/1.3.1/gexf.rnc new file mode 100644 index 0000000..3cf080a --- /dev/null +++ b/specs/1.3.1/gexf.rnc @@ -0,0 +1,137 @@ +default namespace = "http://gexf.net/1.3.1" +namespace viz = "http://gexf.net/1.3.1/viz" +namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" +namespace rng = "http://relaxng.org/ns/structure/1.0" +datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" + +include "common.rnc" +include "dynamics.rnc" +include "_viz.rnc" inherit = viz + +## Grammar root + +start = element gexf { gexf-content } + +# Gexf +gexf-content = + attribute version { string "1.3.1" } + & attribute variant { xsd:string }? + & (element meta { meta-content }? + , element graph { graph-content }) + +# Meta +meta-content = + attribute lastmodifieddate { xsd:date }? + & element creator { text }? + & element keywords { text }? + & element title { text }? + & element description { text }? + +# Graph +graph-content = + attribute defaultedgetype { defaultedgetype-type }? + & attribute idtype { idtype-type }? + & (element attributes { attributes-content }* + , element nodes { nodes-content } + , element edges { edges-content }) + +# Nodes +nodes-content = + attribute count { xsd:nonNegativeInteger }? + & element node { node-content }* + +# Edges +edges-content = + attribute count { xsd:nonNegativeInteger }? + & element edge { edge-content }* + +# Node +node-content = + attribute id { id-type } + & attribute label { xsd:token }? + & element attvalues { attvalues-content }? + +# Edge +edge-content = + attribute id { id-type }? + & attribute type { edgetype-type }? + & attribute label { xsd:token }? + & attribute source { id-type } + & attribute target { id-type } + & attribute weight { weight-type }? + & attribute kind { xsd:token}? + & element attvalues { attvalues-content }? + +## Hierarchy + +# Extends nodes +node-content &= + attribute pid { id-type }? + & element nodes { nodes-content }? + & element edges { edges-content }? + +## Phylogenics + +# Extends nodes +node-content &= + element parents { parents-content }? + +# Parents +parents-content = + element parent { parent-content }* + +# Parent +parent-content = + attribute for { id-type } + +## Attributes + +# Attributes +attributes-content = + attribute class { class-type } + & element attribute { attribute-content }* + +# Attribute +attribute-content = + attribute id { id-type } + & attribute title { xsd:string } + & attribute type { attrtype-type } + & element default { text }? + & element options { text }? + +# Attribute values (for nodes and edges) +attvalues-content = + element attvalue { attvalue-content }* + +# Attribute value +attvalue-content = + attribute for { id-type } + & attribute value { xsd:string } + +## Datatypes + +# Default edge type +defaultedgetype-type = [ a:defaultValue = "undirected" ] + string "directed" | + string "undirected" | + string "mutual" + +# Edge type +edgetype-type = [ a:defaultValue = "undirected" ] + string "directed" | + string "undirected" | + string "mutual" + +# Id type +# id-type = +# xsd:string | xsd:integer | xsd:long + +# Id type (for graph) +idtype-type = [ a:defaultValue = "string" ] + string "integer" | + string "string" + +# Edge weigth +weight-type = [ a:defaultValue = "1.0" ] + xsd:double + diff --git a/specs/1.3.1/gexf.rng b/specs/1.3.1/gexf.rng new file mode 100644 index 0000000..f679c7f --- /dev/null +++ b/specs/1.3.1/gexf.rng @@ -0,0 +1,316 @@ + + + + + + + Grammar root + + + + + + + + + 1.3.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hierarchy + + + + + + + + + + + + + + + + + + + + + Phylogenics + + + + + + + + + + + + + + + + + + + + + + + Attributes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Datatypes + + directed + undirected + mutual + + + + + + directed + undirected + mutual + + + + + + + integer + string + + + + + + + diff --git a/specs/1.3.1/gexf.xsd b/specs/1.3.1/gexf.xsd new file mode 100644 index 0000000..e010007 --- /dev/null +++ b/specs/1.3.1/gexf.xsd @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Datatypes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/specs/1.3.1/ns1.xsd b/specs/1.3.1/ns1.xsd new file mode 100644 index 0000000..d02f76f --- /dev/null +++ b/specs/1.3.1/ns1.xsd @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/specs/1.3.1/viz.rnc b/specs/1.3.1/viz.rnc new file mode 100644 index 0000000..11cc2a8 --- /dev/null +++ b/specs/1.3.1/viz.rnc @@ -0,0 +1,2 @@ +include "common.rnc" +include "_viz.rnc" \ No newline at end of file diff --git a/specs/1.3.1/viz.rng b/specs/1.3.1/viz.rng new file mode 100644 index 0000000..a7eaa00 --- /dev/null +++ b/specs/1.3.1/viz.rng @@ -0,0 +1,5 @@ + + + + + diff --git a/specs/1.3.1/viz.xsd b/specs/1.3.1/viz.xsd new file mode 100644 index 0000000..5fb08da --- /dev/null +++ b/specs/1.3.1/viz.xsd @@ -0,0 +1,5 @@ + + + + + diff --git a/specs/README.md b/specs/README.md index eddf0de..e9d0c71 100644 --- a/specs/README.md +++ b/specs/README.md @@ -6,19 +6,19 @@ Follow these instructions to convert the source files (.rnc files) into destinat ## Requirements -Install the [trang](https://relaxng.org/jclark/trang.html) utility, also available on [Homebrew](https://formulae.brew.sh/formula/jing-trang) for Mac OS. +Install the [trang](https://relaxng.org/jclark/trang.html) and [jing](https://relaxng.org/jclark/jing.html) utilities, also available on [Homebrew](https://formulae.brew.sh/formula/jing-trang) for Mac OS. ## Convert a single file Run this command to for example convert `gexf.rnc` into `gexf.xsd`: -```trang -I rnc -O xsd 1.3/gexf.rnc 1.3/gexf.xsd``` +`trang -I rnc -O xsd 1.3/gexf.rnc 1.3/gexf.xsd` ## Rebuild all Execute the provided `build.sh` script with the folder name, e.g. -```build.sh 1.3``` +`build.sh 1.3` --- @@ -26,4 +26,4 @@ Execute the provided `build.sh` script with the folder name, e.g. To validate a GEXF file against the specification executre the provided `validate.sh` script with the specs folder name, e.g. -```validate.sh 1.3 test.gexf``` \ No newline at end of file +`validate.sh 1.3 test.gexf` diff --git a/specs/build.sh b/specs/build.sh index 1b88228..5438ae8 100755 --- a/specs/build.sh +++ b/specs/build.sh @@ -20,7 +20,10 @@ fi echo "Rebuilding all files in $dir" while IFS= read -r -d $'\0' rncfile; do - echo "Building file $(basename "${rncfile}")" - trang -I rnc -O xsd $rncfile $dir/$(basename "${rncfile}" .rnc).xsd - trang -I rnc -O rng $rncfile $dir/$(basename "${rncfile}" .rnc).rng + if [[ $(basename "${rncfile}") != _* ]] + then + echo "Building file $(basename "${rncfile}")" + trang -I rnc -O xsd $rncfile $dir/$(basename "${rncfile}" .rnc).xsd + trang -I rnc -O rng $rncfile $dir/$(basename "${rncfile}" .rnc).rng + fi done < <(find "$dir" -name "*.rnc" -print0)