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

Annotations #18

Open
ndw opened this issue Feb 11, 2016 · 6 comments
Open

Annotations #18

ndw opened this issue Feb 11, 2016 · 6 comments

Comments

@ndw
Copy link
Collaborator

ndw commented Feb 11, 2016

It would be nice to provide annotations as well.

@htInEdin
Copy link
Collaborator

Norman Walsh writes:

It would be nice to provide annotations as well.

Is that different from meta-data? I presume so, but I didn't understand
it when someone mentioned annotations this morning, and I still don't :-(.

ht

   Henry S. Thompson, School of Informatics, University of Edinburgh
  10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: [email protected]
                   URL: http://www.ltg.ed.ac.uk/~ht/

[mail from me always has a .sig like this -- mail without it is forged spam]

@xquery
Copy link

xquery commented Feb 11, 2016

this is about meta data on the step itself ... to be able to introspect ... though we could achieve the same with a concept of read only option I guess.

@htInEdin
Copy link
Collaborator

James Fuller writes:

this is about meta data on the step itself ... to be able to
introspect ... though we could achieve the same with a concept of read
only option I guess.

Example? Still not getting it, sorry.

ht

   Henry S. Thompson, School of Informatics, University of Edinburgh
  10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: [email protected]
                   URL: http://www.ltg.ed.ac.uk/~ht/

[mail from me always has a .sig like this -- mail without it is forged spam]

@xquery
Copy link

xquery commented Feb 11, 2016

https://www.w3.org/TR/xquery-30/#id-annotations

annotations in XQuery are the closest analog ... with RESTXQ being a good example usage

http://exquery.github.io/exquery/exquery-restxq-specification/restxq-1.0-specification.html

@ndw
Copy link
Collaborator Author

ndw commented Feb 11, 2016

It's just a form of structured metadata that can be used for the purposes of introspection. Consider this example from XQuery:

declare %foo function name() {...}

The "%foo" part is an annotation. I can, at runtime, ask what annotations does a particular function have or ask for a list of all of the functions that have a particular annotation.

These can be used directly by the processor but they can also be used by users as an extension point.

As an example of the former, consider the case where you want to define a module of XProc steps and flows. Perhaps it is convenient to modularize the code in a particular way such that there is a "flushthemanifolds" step or flow but you do not want that step or flow to be part of the module's public API. We could define an annotation, %private, that has the effect of making any step or flow so annotated invisible outside of the module. Then you could have:

step publicSomething() { ... flushthemanifolds() ... }
step publicSomethingElse() { ... flushthemanifolds() ... }
step %private flushthemanifolds() { .... }

Anyone importing this module can call the two public steps but cannot call the %private one.

An example of user extension would be using annotations to identify steps or flows that have particular REST semantics.

It's very handy.

@htInEdin
Copy link
Collaborator

Norman Walsh writes:

It's just a form of structured metadata that can be used for the
purposes of introspection. Consider this example from XQuery:

...

Thanks, got it.

ht

   Henry S. Thompson, School of Informatics, University of Edinburgh
  10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: [email protected]
                   URL: http://www.ltg.ed.ac.uk/~ht/

[mail from me always has a .sig like this -- mail without it is forged spam]

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

3 participants