Use a unified output directory with .js or .mjs extensions
6 files changed
tree: f32009d374df00096d2f32d5454c9092de448f09
  1. .asf.yaml
  2. .editorconfig
  3. .eslintignore
  4. .eslintrc.js
  5. .gitignore
  6. .lintstagedrc
  7. .mocharc.js
  8. .ratignore
  9. .travis.yml
  10. CODE_OF_CONDUCT.md
  11. DISCLAIMER-WIP
  12. LICENSE
  13. Makefile
  14. NOTICE
  15. README.md
  16. SECURITY.md
  17. babel-register.js
  18. babel.config.js
  19. husky.config.js
  20. lerna.json
  21. nyc.config.js
  22. package.json
  23. packages/
  24. repolinter.json
  25. test/
  26. tsconfig.base.json
  27. tsconfig.json
  28. web/
  29. yarn.lock
README.md

Apache Annotator (incubating) Build Status

Apache Annotator provides annotation enabling code for browsers, servers, and humans.

Usage

We‘re currently pre-releasing development copies of each library that makes up the sum total of Apache Annotator’s code. You can grab any of them from our npm organization.

$ # for example...
$ npm install --save @annotator/dom
Requirements
  • node ^10 || ^11 || ^12 || >=13.7
  • yarn ^1.5

Development

Requirements

We use Lerna to juggle the various Apache Annotator libraries. If you‘d like to contribute, you’ll need the following:

  • node ^10 || ^11 || ^12 || >=13.7
  • yarn ^1.5
Setup
$ yarn install
Test
$ yarn test
Run localhost demo server
$ yarn start

Once the test server has started, you can browse a local demo, and run tests in a browser by visiting http://localhost:8080/.

Selectors

Many Annotations refer to part of a resource, rather than all of it, as the Target. We call that part of the resource a Segment (of Interest). A Selector is used to describe how to determine the Segment from within the Source resource.

The W3C Web Annotation Data Model outlines a number of different selectors. See table below for full list and status.

SelectorDescriptionImplementation Status
Text QuoteThis Selector describes a range of text, including some of the text immediately before (a prefix) and after (a suffix) it to distinguish between multiple copies of the same sequence of characters.Yes
CSSCSS Selectors allow for a wide variety of well supported ways to describe the path to an element in a web page.Yes
Text PositionThis Selector describes a range of text by recording the start and end positions of the selection in the stream.No
FragmentUses the fragment part of an IRI defined by the representation's media type.No
XPathImplements an XPath based selection.No
Data PostionSimilar to the Text Position Selector, the Data Position Selector uses the same properties but works at the byte in bitstream level rather than the character in text level.No
SVGAn SvgSelector defines an area through the use of the Scalable Vector Graphics standard.No
RangeA Range Selector can be used to identify the beginning and the end of the selection by using other Selectors.Yes
RefinementSelect a part of a selection, rather than as a selection of the complete resource.

Web Annotation Data Model Validation

If you have any Web Annotation Data Model JSON documents, you can validate them using the validate script:

$ yarn validate --url https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/correct/anno1.json

With the --url option you can pass in a URL or a local path to a JSON file.

Examples

Valid:

https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/correct/anno1.json

Invalid:

https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/incorrect/anno1.json

(More)

License

Apache License 2.0

Validate Licensing

Apache Rat (Release Audit Tool) is a preferred code license checking tool used by the ASF. The included .ratignore file contains a list of files to exclude from scans.

To check for included licenses, run the following and view the output report:

java -jar ~/bin/apache-rat-0.13/apache-rat-0.13.jar -E .ratignore -d . > rat_report.txt

Disclaimer

Apache Annotator is currently undergoing incubation at The Apache Software Foundation.

See the accompanying DISCLAIMER file for details.