Skip to content
New issue

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

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

Already on GitHub? # to your account

Read from STDIN #244

Closed
mielvds opened this issue Apr 13, 2022 · 1 comment
Closed

Read from STDIN #244

mielvds opened this issue Apr 13, 2022 · 1 comment
Labels
Improvement Doing the same thing but better
Milestone

Comments

@mielvds
Copy link

mielvds commented Apr 13, 2022

From a prior discussion:

aha I see! Well too bad you can't do fx -q imma-artists.sparql -o imma-artists.xml -f xml | fx -q imma-artist.sparql - -p "artists/?artistNickname.jsonld" -f json :)

I haven't thought of getting STDIN, not impossible, but it would probably look more like:

fx -q imma-artists.sparql -f xml | fx -q imma-artist.sparql -i -p "artists/?artistNickname.jsonld" -f json` -- where -i without argument would attempt to catch STDIN...

Originally posted by @enridaga in #213 (reply in thread)

Could stdin be implemented, for instance for piping JSON into SA?

Expected behaviour:

  • other that the source of input, it should behave the same as reading the data from file
  • an empty -i means reading from stdin
  • when -i is empty,-f is mandatory and the CLI should complain if it's missing.

And I don't know how useful this is, but perhaps something like

    SERVICE <x-sparql-anything:> {
        fx:properties fx:location <x-sparql-anything:stdin> .
        ?tvSeries xyz:name ?seriesName .
        ?tvSeries xyz:stars ?star .
        ?star fx:anySlot "Courteney Cox" .
    }
@luigi-asprino luigi-asprino added the Improvement Doing the same thing but better label Aug 3, 2022
@enridaga enridaga added this to the v0.9.0 milestone Dec 18, 2022
@luigi-asprino luigi-asprino modified the milestones: v0.9.0, v1.0.0 Jun 29, 2023
luigi-asprino added a commit that referenced this issue Aug 26, 2024
@luigi-asprino
Copy link
Member

6978afc introduces the read-from-std-in option which allows users to pass the data source through the standard input channel.
It is a boolean option and its default value is false.
When it is set as true the engine reads from stdin and sets the input as value for the content option
Therefore, the input from the std is processed as inline content (and the inline content is possibly overwritten by the input from the std in).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Improvement Doing the same thing but better
Projects
None yet
Development

No branches or pull requests

3 participants