{"id":36629036,"url":"https://github.com/pdsinterop/solid-typeindex-parser","last_synced_at":"2026-01-12T09:35:21.605Z","repository":{"id":104965155,"uuid":"338902240","full_name":"pdsinterop/solid-typeindex-parser","owner":"pdsinterop","description":"Parser to manipulate type index files for Solid","archived":false,"fork":false,"pushed_at":"2024-07-24T13:43:01.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-24T15:50:05.892Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pdsinterop.org/solid-typeindex-parser/","language":"JavaScript","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/pdsinterop.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-14T21:07:47.000Z","updated_at":"2024-07-24T13:43:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2f3ef6c-a772-41f2-8e61-19bb9bb4708c","html_url":"https://github.com/pdsinterop/solid-typeindex-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pdsinterop/solid-typeindex-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fsolid-typeindex-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fsolid-typeindex-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fsolid-typeindex-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fsolid-typeindex-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdsinterop","download_url":"https://codeload.github.com/pdsinterop/solid-typeindex-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdsinterop%2Fsolid-typeindex-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-12T09:35:20.887Z","updated_at":"2026-01-12T09:35:21.601Z","avatar_url":"https://github.com/pdsinterop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solid Type Index Parser\n\nA js library for working with typeindex files. It allows you to parse the turtle representation, update entries and finally convert it back to turtle. *It does not cover fetching typeindex files.*\n\n## Basic example\nThis example demonstrates how to parse a turtle string into an TypeIndexDoc object, then add a type entry and parse it back to turtle.\n\n```javascript\nconst SolidTypeIndexParser = require('SolidTypeIndexParser')\n\nconst typeIndexUrl = 'https://pod.example.org/settings/privateTypesIndex.ttl'\nconst turtle = `\n@prefix : \u003c#\u003e.\n@prefix solid: \u003chttp://www.w3.org/ns/solid/terms#\u003e.\n@prefix schem: \u003chttp://schema.org/\u003e.\n@prefix terms: \u003chttp://purl.org/dc/terms/\u003e.\n\n\u003c\u003e a solid:ListedDocument, solid:TypeIndex.`\n\nconst { TypeIndexParser } = SolidTypeIndexParser\n\nasync function main() {\n  // Parse the turtle to an TypeIndexDoc object which we can modify\n  const parser = new TypeIndexParser({ typeIndexUrl })\n  const doc = await parser.turtleToTypeIndexDoc(turtle)\n\n  // Give the type to the type index\n  const solidType = new SolidType(\n    \"http://www.w3.org/2002/01/bookmark#Bookmark\",\n    \"/public/bookmarks.ttl\");\n  }\n  doc.addType(solidType,{ subjectId: '#bookmarks' })\n\n  // Parse it back to turtle so we can store it in the pod\n  const newTurtle = await parser.typeIndexDocToTurtle(doc)\n  console.log(newTurtle)\n}\nmain()\n```\n\nOutput turtle\n```text/turtle\n@prefix : \u003c#\u003e.\n@prefix solid: \u003chttp://www.w3.org/ns/solid/terms#\u003e.\n@prefix schem: \u003chttp://schema.org/\u003e.\n@prefix terms: \u003chttp://purl.org/dc/terms/\u003e.\n\n\u003c\u003e\n    a solid:ListedDocument, solid:TypeIndex;\n    terms:references :bookmarks.\n\n:bookmarks\n    a solid:TypeRegistration;\n    solid:forClass \u003chttp://www.w3.org/2002/01/bookmark#Bookmark\u003e;\n    solid:instance \u003c/public/bookmarks.ttl\u003e.\n```\n\nExample for a registration with an instanceContainer\n```javascript\nconst SolidTypeIndexParser = require('SolidTypeIndexParser')\n\nconst typeIndexUrl = 'https://pod.example.org/settings/privateTypesIndex.ttl'\nconst turtle = `\n@prefix : \u003c#\u003e.\n@prefix solid: \u003chttp://www.w3.org/ns/solid/terms#\u003e.\n@prefix schem: \u003chttp://schema.org/\u003e.\n@prefix terms: \u003chttp://purl.org/dc/terms/\u003e.\n\n\u003c\u003e a solid:ListedDocument, solid:TypeIndex.`\n\nconst { TypeIndexParser } = SolidTypeIndexParser\n\nasync function main() {\n  // Parse the turtle to an TypeIndexDoc object which we can modify\n  const parser = new TypeIndexParser({ typeIndexUrl })\n  const doc = await parser.turtleToTypeIndexDoc(turtle)\n\n  // Give the type to the type index\n  const solidType = new SolidType(\n    \"http://www.w3.org/2002/01/bookmark#Bookmark\",\n    undefined,\n    \"/public/bookmarks/\");\n  }\n  doc.addType(solidType,{ subjectId: '#bookmarks' })\n\n  // Parse it back to turtle so we can store it in the pod\n  const newTurtle = await parser.typeIndexDocToTurtle(doc)\n  console.log(newTurtle)\n}\nmain()\n```\n\nOutput turtle\n```text/turtle\n@prefix : \u003c#\u003e.\n@prefix solid: \u003chttp://www.w3.org/ns/solid/terms#\u003e.\n@prefix schem: \u003chttp://schema.org/\u003e.\n@prefix terms: \u003chttp://purl.org/dc/terms/\u003e.\n\n\u003c\u003e\n    a solid:ListedDocument, solid:TypeIndex;\n    terms:references :bookmarks.\n\n:bookmarks\n    a solid:TypeRegistration;\n    solid:forClass \u003chttp://www.w3.org/2002/01/bookmark#Bookmark\u003e;\n    solid:instanceContainer \u003c/public/bookmarks/\u003e.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdsinterop%2Fsolid-typeindex-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdsinterop%2Fsolid-typeindex-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdsinterop%2Fsolid-typeindex-parser/lists"}