Skip to content

Fluent API for reading structured data #2700

@renyuneyun

Description

@renyuneyun

Search terms you've used

  • fluent
  • fluent api

Feature suggestion

A fluent API for reading data.

Currently there is only a fluent API for constructing data. But it would be also possible (and maybe more widely usable) to create a fluent API for reading data.
In fact, the current style is almost there, but just with the addition of introducing relevant methods to the relevant types, instead of chaining function calls.

Expected functionality/enhancement

  • Allow directly calling methods when reading structured data, instead of chaining function calls, to be more intuitive.
  • Relevant methods for dealing with potentially multiple values/objects of the same subject & predicate.
  • If the value is a URL (e.g. originally obtained by getUrl), allow "resolving" it as a Thing.
    • This may be provided in the first-level as well, saving the potential duplication of getSolidDataset.
    • Of course, corner-cases may need to be handled.
      • In particular, what if the current dataset already has triples of that URL (as subject)? That's why "resolving" (by fetching the dataset matching that URL) should not be the default behaviour. Maybe should also provide a method/function to "merge" the two datasets.

Use Cases

Easier development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions