{"id":21620798,"url":"https://github.com/miku/ntto","last_synced_at":"2025-07-12T02:04:43.027Z","repository":{"id":17331713,"uuid":"20102793","full_name":"miku/ntto","owner":"miku","description":"Small n-triples to line delimited JSON converter and prefix cutter.","archived":false,"fork":false,"pushed_at":"2019-08-05T14:28:57.000Z","size":72,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T06:33:56.412Z","etag":null,"topics":["code4lib"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/miku.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-23T14:40:32.000Z","updated_at":"2020-02-11T01:41:53.000Z","dependencies_parsed_at":"2022-07-26T18:02:30.818Z","dependency_job_id":null,"html_url":"https://github.com/miku/ntto","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miku%2Fntto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miku%2Fntto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miku%2Fntto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miku%2Fntto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miku","download_url":"https://codeload.github.com/miku/ntto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248366890,"owners_count":21092059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code4lib"],"created_at":"2024-11-24T23:12:57.816Z","updated_at":"2025-04-11T09:18:50.248Z","avatar_url":"https://github.com/miku.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"ntto\n====\n\n[![Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive)\n\nMinimal n-triples toolkit. It can:\n\n* shrink n-triples by applying namespace abbreviations (given some rules)\n* convert n-triples to line delimited JSON (.ldj)\n\nTo list the abbreviation rules, run:\n\n    $ ntto -d\n\nTo create an abbreviated NT file from an NT file, run:\n\n    $ ntto -o OUTPUT.NT -a FILE.nt\n\nTo create an abbreviated JSON file from an NT file, run:\n\n    $ ntto -a -j FILE.nt \u003e OUTPUT.LDJ\n\nTo create an abbreviated JSON file from an NT file while ignoring conversion errors, run:\n\n    $ ntto -a -j -i FILE.nt \u003e OUTPUT.LDJ\n\nTo create an abbreviated JSON file from an NT file while ignoring conversion errors and using a custom RULES file, run:\n\n    $ ntto -r RULES -a -j -i FILE.nt \u003e OUTPUT.LDJ\n\nInstallation\n------------\n\nRPM and DEB packages can be found under [releases](https://github.com/miku/ntto/releases).\n\nWith a proper Go setup, a\n\n    $ go get github.com/miku/ntto/cmd/ntto\n\nshould work as well.\n\nUsage\n-----\n\n    $ ntto\n    Usage: ntto [OPTIONS] FILE\n      -a    abbreviate n-triples using rules\n      -c    dump constructed sed command and exit\n      -cpuprofile string\n            write cpu profile to file\n      -d    dump rules and exit\n      -i    ignore conversion errors\n      -j    convert nt to json\n      -n string\n            string to indicate empty string replacement (default \"\u003cNULL\u003e\")\n      -o string\n            output file to write result to\n      -r string\n            path to rules file, use built-in if none given\n      -v    prints current version and exits\n      -w int\n            parallelism measure (default 4)\n\nMode of operation\n-----------------\n\n`ntto` takes a RULES file (alternatively uses some [hardwired](https://github.com/miku/ntto/blob/master/rules.go) rules) to abbreviate\ncommon prefixes in a n-triple file. `ntto` does not do the replacements itself, but outsources it to external programs, like `replace` or `perl`.\n\nWith the help of `replace` ntto can shorten up to 3M lines per second. The resulting\nfile size can be up to 50% of the size of the original file.\n\nExample rules file\n------------------\n\n    $ cat RULES\n    # example rules file\n    dbp             http://dbpedia.org/resource/\n    gnd             http://d-nb.info/gnd/\n    dnbes           http://d-nb.info/standards/elementset/gnd#\n    dnbac           http://d-nb.info/standards/vocab/gnd/geographic-area-code#\n    dnbv            http://d-nb.info/standards/vocab/gnd/\n\n    viaf            http://viaf.org/viaf/\n    frbr            http://rdvocab.info/uri/schema/FRBRentitiesRDA/\n    rdgr            http://rdvocab.info/ElementsGr2/\n\n    # empty lines are ignored, as are comments\n\n    foaf            http://xmlns.com/foaf/0.1/\n    rdf             http://www.w3.org/1999/02/22-rdf-syntax-ns#\n    rdfs            http://www.w3.org/2000/01/rdf-schema#\n    schema          http://schema.org/\n    dc              http://purl.org/dc/elements/1.1/\n    dcterms         http://purl.org/dc/terms/\n\nPerformance data point\n----------------------\n\n    $ wc -l file.nt\n    114171541\n\n    $ time ntto -o output.nt -a file.nt\n    real    1m51.202s\n    user    1m3.626s\n    sys     0m13.602s\n\n    $ time ntto -a -j file.nt \u003e output.ldj\n    real    15m47.872s\n    user    16m19.516s\n    sys      2m3.013s\n\nSometimes, less is more, but YMMV:\n\n    $ time ntto -w 2 -a -j file.nt \u003e output.ldj\n    real    12m3.619s\n    user    15m17.422s\n    sys     2m14.430s\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiku%2Fntto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiku%2Fntto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiku%2Fntto/lists"}