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

specification of expression map #46

Merged
merged 7 commits into from
Mar 29, 2023
Merged

Conversation

pmaria
Copy link
Collaborator

@pmaria pmaria commented Apr 8, 2022

a version of the model diagram that reflects this description was added to https://drive.google.com/file/d/16YyuZrhNfaHhjWj8hGlwnfOmX32hb_cg/view?usp=sharing (tab RML (ExpressionMap))

@srodriguez142857
Copy link

An expression map has at least:

  • 0 or 1 rr:constant
  • 0 or 1 rml:reference
  • 0 or 1 rr:template
    Hence, an expression map can be empty, i.e. it could not have any properties. Is this desirable?

@srodriguez142857
Copy link

With rr:constant, an [=expression map=] will always generate the same value.
This is good in a functional programming paradigm, where the values are unmutable.

  • Question: is there a way to "reference" this same [=expression map=] so that it can be "reused" anywhere?
  • This leads to the following: does any [=expression map=] have a unique ID? how to define it?

@srodriguez142857
Copy link

For reference expressions:

  • How and where to define the [=reference formulation=]?
  • Does a [=reference formulation=] can be also an Expression Map?

@andimou
Copy link
Contributor

andimou commented Apr 11, 2022

An expression map has at least:

* 0 or 1 `rr:constant`

* 0 or 1 `rml:reference`

* 0 or 1 `rr:template`
  Hence, an _expression map_ can be **empty**, i.e. it could not have any properties.  Is this desirable?

I think it is desirable because we want to be able to have no costant/reference/template but have a termtype indicating that this is a blank node

@andimou
Copy link
Contributor

andimou commented Apr 11, 2022

* Does a [=reference formulation=] can be also an _Expression Map_?

this is a very interesting question, do we have use cases where this would be needed?

@anaigmo
Copy link
Collaborator

anaigmo commented Apr 11, 2022

a version of the model diagram that reflects this description was added to https://drive.google.com/file/d/16YyuZrhNfaHhjWj8hGlwnfOmX32hb_cg/view?usp=sharing (tab RML (ExpressionMap))

Checking the diagram, I see that rml:DatatypeMap and rml:LanguageMap are direct subclasses of rml:ExpressionMap, but not of rr:TermMap, like rr:ObjectMap, rr:PredicateMap and so on. Is there a reason why they are different to the rest of "maps"?

@pmaria
Copy link
Collaborator Author

pmaria commented Apr 12, 2022

An expression map has at least:

  • 0 or 1 rr:constant
  • 0 or 1 rml:reference
  • 0 or 1 rr:template
    Hence, an expression map can be empty, i.e. it could not have any properties. Is this desirable?

I think this needs to be rewritten to make it open for extensions like e.g. fnml:functionValue. So something like:

An expression map MAY have:

  • 0 or 1 rr:constant or
  • 0 or 1 rml:reference or
  • 0 or 1 rr:template.

@pmaria
Copy link
Collaborator Author

pmaria commented Apr 12, 2022

With rr:constant, an [=expression map=] will always generate the same value. This is good in a functional programming paradigm, where the values are unmutable.

  • Question: is there a way to "reference" this same [=expression map=] so that it can be "reused" anywhere?
  • This leads to the following: does any [=expression map=] have a unique ID? how to define it?

You can name the expression map using an IRI or blank node with id to reuse it on the mapping level.

What a processor does with that information is up to the processor.

@pmaria
Copy link
Collaborator Author

pmaria commented Apr 12, 2022

For reference expressions:

  • How and where to define the [=reference formulation=]?

I believe this will be defined in core and further extended in the logical source and target spec.

  • Does a [=reference formulation=] can be also an Expression Map?

I don't see a use case for that directly. Do you have something in mind?

@pmaria
Copy link
Collaborator Author

pmaria commented Apr 12, 2022

a version of the model diagram that reflects this description was added to https://drive.google.com/file/d/16YyuZrhNfaHhjWj8hGlwnfOmX32hb_cg/view?usp=sharing (tab RML (ExpressionMap))

Checking the diagram, I see that rml:DatatypeMap and rml:LanguageMap are direct subclasses of rml:ExpressionMap, but not of rr:TermMap, like rr:ObjectMap, rr:PredicateMap and so on. Is there a reason why they are different to the rest of "maps"?

Yes indeed, sharp observation. They are disjoint from term maps because they do not generate terms. Rather, they generate "elements" of literal terms. That is one of the reasons to introduce expression map as a(n abstract) class. Along with the possibility to use expressions elsewhere in the language as well via this construct.

@srodriguez142857
Copy link

For reference expressions:

  • Does a [=reference formulation=] can be also an Expression Map?

I don't see a use case for that directly. Do you have something in mind?

Based on the results of an Expression Map (or a function for that matter), one could "dynamically" generate a way to:

  • access a subset of related data sources, depending on their location and file naming schemes, e.g. /path1/file-1.csv, /path2/file-2.json, etc.
  • define the [=reference formulation=] based on the "nature" of the data source.
  • other similar use cases.

@srodriguez142857
Copy link

Checking the diagram, I see that rml:DatatypeMap and rml:LanguageMap are direct subclasses of rml:ExpressionMap, but not of rr:TermMap, like rr:ObjectMap, rr:PredicateMap and so on. Is there a reason why they are different to the rest of "maps"?

Yes indeed, sharp observation. They are disjoint from term maps because they do not generate terms. Rather, they generate "elements" of literal terms. That is one of the reasons to introduce expression map as a(n abstract) class. Along with the possibility to use expressions elsewhere in the language as well via this construct.

So, Expression Maps are specialised functions for literal values?
Are they intended to be evaluated as "C macros" or "XML DTD entities" (text replacement/expansion) or functions that will be executed and generate literal values?
If they are treated as functions, what is their declaration syntax?

@pmaria
Copy link
Collaborator Author

pmaria commented Apr 12, 2022

So, Expression Maps are specialised functions for literal values?
Are they intended to be evaluated as "C macros" or "XML DTD entities" (text replacement/expansion) or functions that will be executed and generate literal values?
If they are treated as functions, what is their declaration syntax?

No expressions are expressions in terms of a reference formulation. So e.g. an XPath or JSONPath expression.

Usage in a more specific subclasses dictates what the expression result will be used for ultimately.

@pmaria pmaria marked this pull request as ready for review December 19, 2022 08:36
@andimou andimou changed the base branch from main to draft March 29, 2023 12:14
@andimou andimou merged commit c5d99c8 into kg-construct:draft Mar 29, 2023
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

Successfully merging this pull request may close these issues.

None yet

4 participants