xgi-org / xgi-data Goto Github PK
View Code? Open in Web Editor NEWStandardized higher-order datasets with corresponding datasheets
Home Page: https://zenodo.org/communities/xgi
License: Other
Standardized higher-order datasets with corresponding datasheets
Home Page: https://zenodo.org/communities/xgi
License: Other
A python script that accepts a JSON file as input and checks it to make sure that it's in a format that agrees with the specification.
Develop a JSON file format to store hypergraphs in an explainable way.
During our last meeting it came up that GitHub's file size restrictions are harming xgi-data
. After discussing alternatives, I volunteered to determine whether we can host our datasets in Zenodo. We not only want to host but also a programmatic way for users of XGI to download the data sets.
The answer is yes, I think we can do this. This code should work:
import requests
import gzip
import pandas as pd
from io import StringIO
# This URL points to one of the files of this dataset: https://zenodo.org/record/2539424
# It is a compressed plain text file containing a directed edge list
url = 'https://zenodo.org/api/files/c2d18dc0-c4ca-4454-aa3e-fd6e035b4f87/dewiki.wikilink_graph.2003-03-01.csv.gz'
# Download the file and make sure everything went ok
r = requests.get(url)
assert r.ok
# decompress (it is a .gz file) and decode (the return type is bytes, not str) and
data = gzip.decompress(r.content).decode('utf-8')
# Now data is a string with the entire contents of the downloaded file. Since pd.read_csv
# expects a file and not a string, use StringIO to give the data a file-like interface.
# Also, watch the delimiter!
df = pd.read_csv(StringIO(data), delimiter='\t')
df.head()
# page_id_from page_title_from page_id_to page_title_to
# 0 10 Aussagenlogik 7334 Äquivalenz
# 1 10 Aussagenlogik 767 Boolesche Algebra
# 2 10 Aussagenlogik 1217 Disjunktion
# 3 10 Aussagenlogik 2446 Implikation
# 4 10 Aussagenlogik 2895 Konjunktion
So we can easily encapsulate these lines in a function that would then replace xgi.download_xgi_data
.
Convert the datasets at https://www.cs.cornell.edu/~arb/data/ to this format.
Each dataset should have an accompanying README explaining (among other things) the statistics of the hypergraphs, dataset attributes, limitations, details on how the dataset was collected, and references.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.