{"id":15450185,"url":"https://github.com/iand/nquads","last_synced_at":"2025-04-19T22:50:10.236Z","repository":{"id":57544567,"uuid":"297118590","full_name":"iand/nquads","owner":"iand","description":"NQuad parser in Go","archived":false,"fork":false,"pushed_at":"2024-04-04T12:04:06.000Z","size":67,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T19:22:57.871Z","etag":null,"topics":["go","golang","linked-data","parser","rdf","semantic-web"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iand.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-09-20T16:37:11.000Z","updated_at":"2025-03-14T07:29:44.000Z","dependencies_parsed_at":"2023-11-29T10:26:38.427Z","dependency_job_id":"4711616c-e1bd-4bb3-87aa-fd40aaf57d07","html_url":"https://github.com/iand/nquads","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iand%2Fnquads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iand%2Fnquads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iand%2Fnquads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iand%2Fnquads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iand","download_url":"https://codeload.github.com/iand/nquads/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249824094,"owners_count":21330263,"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":["go","golang","linked-data","parser","rdf","semantic-web"],"created_at":"2024-10-01T21:03:45.985Z","updated_at":"2025-04-19T22:50:10.190Z","avatar_url":"https://github.com/iand.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nquads \n\nA basic nquads parser in Go\n\n[![Check Status](https://github.com/iand/nquads/actions/workflows/check.yml/badge.svg)](https://github.com/iand/nquads/actions/workflows/check.yml)\n[![Test Status](https://github.com/iand/nquads/actions/workflows/test.yml/badge.svg)](https://github.com/iand/nquads/actions/workflows/test.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/iand/nquads)](https://goreportcard.com/report/github.com/iand/nquads)\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white)](https://pkg.go.dev/github.com/iand/nquads)\n\n## Overview\n\n[N-Quads](https://www.w3.org/TR/n-quads/) is a serialisation format for [RDF datasets](https://www.w3.org/TR/rdf11-concepts/#section-dataset).\nA dataset consists of a default graph with no name and zero or more named graphs where a graph is a composed of a set of triples. The default \ngraph may be empty. \n\nAn N-Quads file is a line-oriented format where each triple or quad statement is terminated by a period `.`.\n\n - IRIs are enclosed by `\u003c` and `\u003e`\n - Literals have a lexical value enclosed by `\"` followed by an optional language tag using `@` as a delimiter, or a data type IRI using `^^` as a delimiter\n - Blank nodes have a lexical label prefixed by `_:` and the same label denotes the same blank node throughout the file.\n\nA triple in a named graph may be written as a statement using four terms, the last of which is the name of the graph:\n\n```\n\u003chttp://example/s\u003e \u003chttp://example/p\u003e \u003chttp://example/o\u003e \u003chttp://example/g\u003e .\n```\n\nA triple in the default graph omits the fourth term:\n\n```\n\u003chttp://example/s\u003e \u003chttp://example/p\u003e \u003chttp://example/o\u003e .\n```\n\n## Getting Started\n\nExample of parsing an nquads file and printing out every 5000th quad\n\n```Go\n\tpackage main\n\n\timport (\n\t\t\"fmt\"\n\t\t\"os\"\n\t\t\"github.com/iand/nquads\"\n\t)\t\n\n\tfunc main() {\n\t\tnqfile, err := os.Open(\"myquads.nq\")\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"Error: %s\", err.Error())\n\t\t\tos.Exit(1)\n\t\t}\n\t\tdefer nqfile.Close()\n\n\n\t\tcount := 0\n\t\tr := nquads.NewReader(nqfile)\n\t\t\n\t\tfor r.Next()\n\t\t\tcount++\n\t\t\tif count % 5000 == 0{\n\t\t\t\tfmt.Printf(\"%s\\n\", r.Quad())\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif r.Err() != nil {\n\t\t\tfmt.Printf(\"Unexpected error encountered: %v\\n\", r.Err())\n\t\t}\n\n\t}\n```\n\n## Author\n\n* [Ian Davis](http://github.com/iand) - \u003chttp://iandavis.com/\u003e\n\n# License\n\nThis is free and unencumbered software released into the public domain. For more\ninformation, see \u003chttp://unlicense.org/\u003e or the accompanying [`UNLICENSE`](UNLICENSE) file.\n\n## Credits\n\nThe design and logic is inspired by Go's standard csv parsing library\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiand%2Fnquads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiand%2Fnquads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiand%2Fnquads/lists"}