matlab-gmlread's People
matlab-gmlread's Issues
More generic handling of NodeProps
cc:/ @Tom-Johnston
We could handle any given property e.g. using regexp(tline, '(?<=^\s*)([^ \t]+)', 'match')
.
For a tline of
some_property some_value
that regexp code will result in 'some_property'
. We'll then be able to create a list of all properties present in the gml file on the first run through, then initialise the NodeProps table with these columns.
If we're lucky, on the second run through we might be able to do something like
prop = regexp(tline, '(?<=^\s*)([^ \t]+)', 'match');
NodeProps.eval(prop){current_node} = some_other_reg_exp_to_get_some_value
Needs a readme
Nested properties will break the function
It is possible that we have the following:
node
[
id 1
graphics
[
x 1
y 1
]
label "test"
]
This sort of nested structure is not supported.
- It will try to add a graphics column to the NodeProps, but finding the value for graphics may error, or it may just be blank
- The
[
aftergraphics
will be ignored - The
x
andy
will be added to NodeProps, although with no information about being nested undergraphics
. - The
]
ofgraphics
will setinterpreting_node = 0;
which will lead tolabel
either being ignored, or throwing some kind of errors.
We probably need some concept of depth.
Needs testing
Directed graphs are not supported
Error/argument handling
We should really be checking inputs etc etc
e.g.
% Validate input args
narginchk(1,Inf);
% Get Filename
if ~ischar(filename) && ~(isstring(filename) && isscalar(filename))
error(message('MATLAB:csvread:FileNameMustBeString'));
end
filename = char(filename);
% Make sure file exists
if exist(filename,'file') ~= 2
error(message('MATLAB:csvread:FileNotFound'));
end
All edge properties (specifically Weight) are stored as strings, even if they should be numeric
Not sure GML actually "supports" weighted networks in the spec, but "Weight" attributes are clearly possible.
The Matlab class also has NormWeight
, which we could also support/add.
Duplicated code
Currently, the code is very linear and explicit. There are a few lines that are duplicated, specifically between handling edges and handling nodes.
It might be worth having some additional util functions, or maybe combining the edge/node logic into one.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.