{"id":18406214,"url":"https://github.com/prozion/rtabtree","last_synced_at":"2025-04-12T20:28:32.032Z","repository":{"id":199882198,"uuid":"703180376","full_name":"prozion/rtabtree","owner":"prozion","description":"R lib to read files in Tabtree format; to generate RDF files from Tabtree","archived":false,"fork":false,"pushed_at":"2023-10-24T20:50:23.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T04:28:15.951Z","etag":null,"topics":["r","rdf","turtle"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prozion.png","metadata":{"files":{"readme":"README.Rmd","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}},"created_at":"2023-10-10T18:41:08.000Z","updated_at":"2023-10-12T11:21:12.000Z","dependencies_parsed_at":"2023-10-13T05:54:23.275Z","dependency_job_id":"afe8a67a-9084-4b0a-a1c8-d1b630da97f9","html_url":"https://github.com/prozion/rtabtree","commit_stats":null,"previous_names":["prozion/rtabtree"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prozion%2Frtabtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prozion%2Frtabtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prozion%2Frtabtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prozion%2Frtabtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prozion","download_url":"https://codeload.github.com/prozion/rtabtree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248628271,"owners_count":21136035,"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":["r","rdf","turtle"],"created_at":"2024-11-06T03:07:30.610Z","updated_at":"2025-04-12T20:28:32.001Z","avatar_url":"https://github.com/prozion.png","language":"R","readme":"---\noutput: github_document\n---\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\nN.B.: This is a \"sketch of a sketch\" for README, the working lib for Tabtree is currently implemented [in Racket language](https://github.com/prozion/tabtree-racket). Transition to R implementation of this library is under way.\n\n# Tabtree\n\nTabtree \u0026mdash; is a compact format to write RDF triples. It uses some syntactic sugar to make a work of editing ontologies in the code editor as easy as possible.\n\n## Tabs define a level in a hierarchy\n\n(The principle similar to Python)\n\n**Tabtree source**\n```tabtree\nAfrica\n  Kenya\n    Elgeyo-Marakwet\n      Iten\nEurope\n  Germany\n    Saxony_Land\n      Dresden\n  Russia\n    City_of_Moscow\n      Belyaevo\n      Zelenograd\n    Rostov_region\n      Taganrog\n        Bogudonia\n```\n\n## Files includes\n\nBig ontologies and knowledge graphs is good to divide into several files, regarding the regions of internal cohesion. And then combine them into one resulting Turtle file, ready for uploading to appropriate semtech application.\n\nHere is an example of pasting `factories.tree` contents into the 'central' file called `main.tree`\n\n**Tabtree source**\n```tabtree\n; main.tree\n\n[factories.tree]\n```\n\n## Reification\n\nFor writing statements like:\n\n*'By March, 2020, the factory produced 2.5% fat strawberry-flavoured yogurt'*\n\n**Tabtree source**\n```tabtree\nMilk_factory product:Yogurt_strawberry^fat:2.5^date:2020-03\n```\n\n**Turtle result**\n```turtle\nStmt_506_product_Yogurt_strawberry\n  rdf:type rdf:Statement ;\n  rdf:subject :Milk_factory ;\n  rdf:predicate :product ;\n  rdf:object :Yogurt_strawberry ;\n  :fat \"2.5\"^^xsd:decimal ;\n  :date \"2020-03\"^^xsd:date .\n```\n\n## Expanding\n\n**+** sign propagates the predicate-object pair among all the children of the node, where this form was written:\n\n**Tabtree source**\n```tabtree\ncities +a:UrbanPlace\n  Beijing\n  Shanghaj\n  Shenzhen\n    Futian_district\n```\n\n**Turtle result**\n```turtle\n:Beijing rdf:type :UrbanPlace .\n:Shanghaj rdf:type :UrbanPlace .\n:Shenzhen rdf:type :UrbanPlace .\n:Futian_district rdf:type :UrbanPlace .\n```\n\n**++** Double-plus sign includes predicate-object to the node of origin:\n\n**Tabtree source**\n```tabtree\n  Moscow ++a:UrbanPlace\n    Zelenograd\n      Noviy_Gorod\n        Microdistrict_14\n```\n\n**Turtle result**\n```turtle\n:Moscow rdf:type :UrbanPlace .\n:Zelenograd rdf:type :UrbanPlace .\n:Noviy_Gorod rdf:type :UrbanPlace .\n:Microdistrict_14 rdf:type :UrbanPlace .\n```\n\n\u003cb\u003e*\u003c/b\u003e Asterisk sign overwrites predicate-object inherited from above, while plain predicate-object without prefixes just adds up to the inherited one:\n\n**Tabtree source**\n```tabtree\n  Moscow ++a:UrbanPlace\n    Zelenograd\n      Stariy_Gorod a:InformallyNamedArea\n        Matushkino-Savelki *a:AdministrativeUnit\n      Noviy_Gorod\n        Microdistrict_14\n```\n\n**Turtle result**\n```turtle\n:Moscow rdf:type :UrbanPlace .\n:Zelenograd rdf:type :UrbanPlace .\n:Stariy_Gorod rdf:type :UrbanPlace, :InformallyNamedArea .\n:Matushkino-Savelki rdf:type :AdministrativeUnit .\n:Noviy_Gorod rdf:type :UrbanPlace .\n:Microdistrict_14 rdf:type :UrbanPlace .\n```\n\n## Tabtree file sections\n\n- namespaces\n- classes\n- properties\n- individuals\n\n## Namespaces\n\n**Tabtree source**\n\u003c!-- ```tabtree\nnamespaces\n  factory ns:http://example.org/namespaces/factory#\n  geoplace ns:http://example.org/namespaces/geoplace#\n  geo ns:http://www.w3.org/2003/01/geo/wgs84_pos#\nindividuals\n  factory/Taganrog_icecream_factory geo/location:geoplace/Taganrog\n``` --\u003e\n\n![\"**Tabtree source**\"](man/figures/p1.png?raw=true \"Namespaces example\")\n\n**Turtle result**\n```\n@prefix :factory \u003chttp://example.org/namespaces/factory#\u003e .\n@prefix :geoplace \u003chttp://example.org/namespaces/geoplace#\u003e .\n@prefix :geo \u003chttp://www.w3.org/2003/01/geo/wgs84_pos#\u003e .\n\nfactory:Taganrog_icecream_factory geo:location geoplace:Taganrog .\n\n```\n\n## Built-ins\n\nShorthand, frequently used predicates and classes, like `rdfs:subClassOf` or `rdfs:range`\n\n**Tabtree source**\n```\n  City subclass-of:UrbanPlace\n```\n\n**Turtle result**\n```\n  :City rdfs:subClassOf :UrbanPlace .\n```\n\n### Table of predicate built-ins\n\n| Tabtree shorthand | Compiles to RDF Turtle |\n| :---:   | :---: |\n| a | rdf:type |\n| instance-of | rdf/type |\n| subclass-of | rdfs/subClassOf |\n| subproperty-of | rdfs/subPropertyOf |\n| alt | owl/sameAs |\n| eq | owl/sameAs |\n| eq-class | owl/equivalentClass |\n| eq-property | owl/equivalentProperty |\n| domain | rdfs/domain |\n| range | rdfs/range |\n| d | rdfs/comment |\n| name | rdfs/label |\n| disjoint-with | owl/disjointWith |\n\n### Table of special classes\n\nThese classes are not compiled to something different, and needed to be declared together with other resources, but in addition, transpiler uses their names to define the type of object at compilation.\n\n| Tabtree class | Corresponds to |\n| :---:   | :---: |\n| Year | rdfs:Literal |\n| Date | xsd:date |\n| String | xsd:string |\n| Double | xsd:double |\n| Float | xsd:float |\n| Decimal | xsd:decimal |\n| PositiveInteger | xsd:positiveInteger |\n| Integer | xsd:integer |\n| Boolean | xsd:boolean |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprozion%2Frtabtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprozion%2Frtabtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprozion%2Frtabtree/lists"}