Code Monkey home page Code Monkey logo

list.mid's Introduction

List.MID

A MIDI-based benchmark for RDF lists

DOI

RDF List models

The currently supported RDF list models are:

  • uri for lists that encode their ordering via URI elements (e.g. integer identifiers)
  • prop_number for lists that encode their ordering via a numeric property
  • prop_time for lists that encoder their ordering via a timestamp
  • seq for lists using the rdf:Seq facility
  • list for lists using the rdf:List facility
  • sop for lists using modelling solutions with the same expressivity as the Sequence Ontology Pattern

Data generator

We propose a data generator based on the midi2rdf algorithm that is compatible with all the aforementioned RDF list models. This specific version of midi2rdf is included in the src directory. The syntax is:

midi2rdf [-h]
         [--format [{xml,n3,turtle,nt,pretty-xml,trix,trig,nquads}]]
         [--gz] [--order [{uri,prop_number,prop_time,seq,list,sop}]]
         [--version]
         filename [outfile]

The executable files can be found in the src directory.

For example, to generate RDF lists according to the seq model (rdf:Seq) on a MIDI of 30k events, we do

midi2rdf.py --format turtle --order seq midi/30k.mid ex_seq_30k.ttl

An example of the resulting RDF file can be found at data/30k-seq.ttl. Various other examples of input MIDI data and output benchmark data can be found in the midi and data directories, respectively.

Queries

The SPARQL queries retrieving the list content according to these models can be found in the queries directory. The queries cover for three different use cases (the wildcard * is used as shorthand for the different RDF list models):

  • ALL-*.sparql. Retrieve all elements of an RDF list in their sequential order
  • A950-*.sparql. Retrieve one element of an RDF list (element in position 950 in this example)
  • W100-850-*.sparql. Retrieve an a-b window of all RDF list elements between elements a and b (from 100 to 850 in this example)

MIDI Linked Data lists

This benchmark uses the data in the MIDI Linked Data cloud dataset to generate RDF lists according to various RDF list models.

Size. To aid the selection of source MIDI lists of the desired sized, this query will return all MIDI tracks of the dataset and their number of (linked) events. Since the query is quite expensive, we have included a dump of the response in the file list-sizes.csv.gz. The list can be searched for the identifier of a MIDI file that contains the list of the chosen size.

Use that identifier as the parameter of this query to download an RDF dump of the MIDI. To convert that dump into a MIDI file for the following step, use the rdf2midi program included in the src directory.

We provide a number of examples in the midi directory, with MIDI lists of 1k, 30k, 60k, 90k, and 120k elements.

list.mid's People

Contributors

albertmeronyo avatar dependabot[bot] avatar

Stargazers

Alfredo Serafini avatar  avatar

Watchers

Andreas Kuckartz avatar James Cloos avatar  avatar

list.mid's Issues

unknown 'midi' module for midi2rdf.py

I don't manage to get the midi2rdf.py program to run. I tried on two different Linux machines and run into the same issue. I should say that I am a total noob regarding Python. Anyways, here is what I tried and how it fails:

I cloned the repo, entered the src/ directory in it, and issued the following command.

python3 midi2rdf.py

Which gave me the following error message.

  File "midi2rdf.py", line 154
    lyrics_label += text_value
                             ^
TabError: inconsistent use of tabs and spaces in indentation

I opened the file, went to the line indicated in the error message (line 154), and saw that the indentation of this line contains a few tabs, whereas all other lines contain spaces only. Given the error message, I assumed that this bug can be fixed by simply changing the indentation style of line 154 to use spaces only. This worked :-)

... at least to the extend that the error message does not show up anymore. However, now I got another one:

Traceback (most recent call last):
  File "midi2rdf.py", line 3, in <module>
    import midi
ModuleNotFoundError: No module named 'midi'

I did a quick search for the last line of this error message and found a suggestion that I need to do:

pip3 install midi

Yet, this one gives me another error:

ERROR: Could not find a version that satisfies the requirement midi (from versions: none)
ERROR: No matching distribution found for midi

Now I am stuck. Do you have any suggestion for how I may try to proceed to get your program to run?

Maybe of interest, the versions of Python and pip with which I have tried: On one of the two computers on which I tried, I have the following.

# python3 --version
Python 3.8.10
# pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

On the other computer:

# python3 --version
Python 3.10.12
# pip3 --version
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

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

  • D3 photo D3

    Data-Driven Documents codes.