Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for the @graphy/content.ttl.write module that adds customization of indentation style #62

Open
alik-kirillovich opened this issue Apr 10, 2023 · 0 comments

Comments

@alik-kirillovich
Copy link

I developed a small patch for the @graphy/content.ttl.write module, that adds customization of the indentation style of the produced Turtle code.

In the Turtle code generated by the original module, the first predicate-objects pair of every subject is on one line with this subject, and any predicate-objects pair is written in one line. When an RDF graph contains long object lists, the generated Turtle code is difficult to read.

For example, in the following Turtle code, the objects of the skos:hasTopConcept predicate either don't fit to the window or break the line thus breaking the code formatting:

<http://example.com/my-concept-scheme> rdf:type skos:Concept, lime:Lexicon ;
    rdfs:label "My concept scheme"@en, "Mi esquema de conceptos"@es, "Моя концептуальная схема"@ru ;
    skos:hasTopConcept <http://example.com/my-concept-scheme/concept1>, <http://example.com/my-concept-scheme/concept2>, <http://example.com/my-concept-scheme/concept3>, <http://example.com/my-concept-scheme/concept4>, <http://example.com/my-concept-scheme/concept5>, <http://example.com/my-concept-scheme/concept6>, <http://example.com/my-concept-scheme/concept7>, <http://example.com/my-concept-scheme/concept8>, <http://example.com/my-concept-scheme/concept9>, <http://example.com/my-concept-scheme/concept10> ;
    dc:creator <http://example.com/john-smith> ;
    dc:language "en" .

The patch allows this code to be formatted e.g. in this, more readable, way:

<http://example.com/my-concept-scheme>
    rdf:type
        skos:Concept,
        lime:Lexicon ;
    rdfs:label
        "My concept scheme"@en,
        "Mi esquema de conceptos"@es,
        "Моя концептуальная схема"@ru ;
    skos:hasTopConcept
        <http://example.com/my-concept-scheme/concept1>,
        <http://example.com/my-concept-scheme/concept2>,
        <http://example.com/my-concept-scheme/concept3>,
        <http://example.com/my-concept-scheme/concept4>,
        <http://example.com/my-concept-scheme/concept5>,
        <http://example.com/my-concept-scheme/concept6>,
        <http://example.com/my-concept-scheme/concept7>,
        <http://example.com/my-concept-scheme/concept8>,
        <http://example.com/my-concept-scheme/concept9>,
        <http://example.com/my-concept-scheme/concept10> ;
    dc:creator
        <http://example.com/john-smith> ;
    dc:language "en" .

The patch (with a detailed description and examples) can be found at: https://github.com/alik-kirillovich/graphy.content.ttl.write-patch.

I tried to integrate the patch into @graphy/content.ttl.write by sending a usual pull request, but I couldn't find the GitHub repository of this module. Could you please see the patch, and if you approve it, integrate it to the @graphy/content.ttl.write?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant