在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jsongraph/json-graph-specification开源软件地址:https://github.com/jsongraph/json-graph-specification开源编程语言:Python 100.0%开源软件介绍:json-graph-specificationA proposal for representing graph structures in JSON. ChangesJan 2020 - Updated to Version 2 by Travis Giggy
Jan 2021 - Updated with hypergraph support by mohawk2
Design principles
Structure Overview (Version 2)nodes objectA nodes object/Map represents nodes in a graph. Each key in the nodes object is the unique identifier for the node. The node object is the value the Map key. node object properties
edge arrayEdges are an array of objects, each of which represents an edge in the graph. edge properties
hyperedge arrayHyperedges are either undirected - i.e. a set of nodes - or directed with a set of source nodes, and a set of target nodes hyperedge properties
graph objectA graph object represents a single conceptual graph. graph properties
Current restriction on having one of edges, undirected hyperedges or directed hyperedges. If this is not a useful restriction, please post a use case in the Issues. graphs objectA graphs object groups zero or more graph objects into one JSON document.
Examplesempty single graph{
"graph": {}
} empty multi graph{
"graphs": []
} nodes-only single graph{
"graph": {
"nodes": {
"A": {},
"B": {}
}
}
} nodes/edges single graph{
"graph": {
"nodes": {
"A": {},
"B": {}
},
"edges": [
{
"source": "A",
"target": "B"
}
]
}
} hyperedges single graph{
"graph": {
"nodes": {
"A": {},
"B": {}
},
"hyperedges": [
{
"nodes": ["A", "B"],
"relation": "associated",
"metadata": {}
}
]
}
} complete single graph{
"graph": {
"directed": false,
"type": "graph type",
"label": "graph label",
"metadata": {
"user-defined": "values"
},
"nodes": {
"0": {
"label": "node label(0)",
"metadata": {
"type": "node type",
"user-defined": "values"
}
},
"1": {
"label": "node label(1)",
"metadata": {
"type": "node type",
"user-defined": "values"
}
}
},
"edges": [
{
"source": "0",
"relation": "edge relationship",
"target": "1",
"directed": false,
"label": "edge label",
"metadata": {
"user-defined": "values"
}
}
]
}
} complete multi graph{
"graphs": [
{
"directed": true,
"type": "graph type",
"label": "graph label",
"metadata": {
"user-defined": "values"
},
"nodes": {
"0": {
"label": "node label(0)",
"metadata": {
"type": "node type",
"user-defined": "values"
}
},
"1": {
"label": "node label(1)",
"metadata": {
"type": "node type",
"user-defined": "values"
}
}
},
"edges": [
{
"source": "0",
"relation": "edge relationship",
"target": "1",
"directed": true,
"label": "edge label",
"metadata": {
"user-defined": "values"
}
}
]
},
{
"directed": true,
"type": "graph type",
"label": "graph label",
"metadata": {
"user-defined": "values"
},
"nodes": {
"0": {
"label": "node label(0)",
"metadata": {
"user-defined": "values"
}
},
"1": {
"label": "node label(1)",
"metadata": {
"user-defined": "values"
}
}
},
"edges": [
{
"source": "1",
"relation": "edge relationship",
"target": "0",
"directed": true,
"label": "edge label",
"metadata": {
"user-defined": "values"
}
}
]
}
]
} SchemaThe JSON graph schema(version 2) is provided for the json graph format. Media TypeThe media type to describe JSON Graph Format is application/vnd.jgf+json. The approach to use a media type suffix like +json is described by RFC 6839. In addition to the media type a profile media type parameter MUST be set to a URL that dereferences to the JSON schema for JSON Graph Format. The expected usage of the profile media type parameter is defined by RFC 6906. For example to communicate plain JSON Graph Format content the Content-Type header could be set as: Content-Type: application/vnd.jgf+json A child schema of JSON Graph Format can communicate its JSON schema using additional profile media type parameters. Each profile media type parameter MUST dereference a JSON schema. For example the BEL JSON Graph Format could be communicated as: Content-Type: application/vnd.jgf+json;
profile=http://jsongraphformat.info/schema.json;
profile=http://jsongraphformat.info/child-schemas/bel-json-graph.schema.json NPM supportYou can import the schema into your JS projects by installing it via NPM and requiring it. npm install --save json-graph-specification var JSONGraph = require('json-graph-specification') Clients
Project TestsSee TESTING. Related Standards {#links}Graph data in JSON is usually modelled in application-specific ad-hoc formats. In addition there are several text-based graph formats:
and XML-based graph formats:
Several semi-standardized JSON-based graph formats are found in applications, for instance Cytoscape JSON. Simple graphs can also be expressed in CSV format. Links |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论