Skip to content

Commit

Permalink
more changes based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
abrin committed Jun 2, 2022
1 parent 3bcdd75 commit d6e8c4a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 80 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# linkedart.js

[Docs](http://linkedartjs.org/) |
[Contributing](https://github.com/thegetty/linkedart.js/blob/master/.github/CONTRIBUTING.md)
[Docs](http://linkedartjs.org/) | [Contributing](https://github.com/thegetty/linkedart.js/blob/master/.github/CONTRIBUTING.md) | [NPM](https://www.npmjs.com/package/@thegetty/linkedart.js)

## What is LinkedArt?

Expand All @@ -11,8 +10,8 @@ LinkedArt is a Linked Open Data model which is used to describe cultural heritag

This library includes a set of methods for working with [linked.art](https://linked.art) data. Easily manipulate and access rich, complexly nested linked data from any LinkedArt source. This library includes different types of functions or methods:

- _Basic Helpers_: for things like getting the Title, Name, Identifier, or other common properties from a LinkedArt Object. Please see the helpers, or examples in our tests.
- _Document Navigation and Filters_: to use when building custom functions and queries -- this includes filtering data by multiple classifications, traversing the JSON-LD structure, and working with languages.
- _Accessors_: Helpers for common use cases like getting the Title, Name, Identifier, or other common properties from a LinkedArt Object. Please see the helpers, or examples in our tests.
- _Document Navigation and Filters_: For building custom functions and queries -- this includes filtering data by multiple classifications, traversing the JSON-LD structure, and working with languages.

## Why did we create this?

Expand Down Expand Up @@ -281,6 +280,15 @@ const result = getClassifiedAs(
// result should equal: "Young Woman Picking Fruit"
```

## List of Files

To better manage the functions into logical groups, this library breaks them into files (described below).

- **Basic Helpers**: Commonly used and shared helpers across the library, mainly for unifying or normalizing the LinkedArt document structure
- **Language Helpers**: Functions for filtering and managing data in multiple languages
- **LinkedArt Helpers**: Mainly low-level accessors and filter logic for working with LinkedArt Document Structure, but also includes some higher-level functions such as getPrimaryName (for getting the title).
- **Object Helpers**: High-level functions for accessing common fields in documents.

## License

This software is licensed under the [BSD-3](https://opensource.org/licenses/BSD-3-Clause) license.
2 changes: 1 addition & 1 deletion jsdoc-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"destination": "jsdoc",
"recurse": true,
"template": "node_modules/better-docs",
"readme": "src/docs/jsdoc_home.md"
"readme": "./README.md"
},
"markdown.hardwrap": true,
"markdown": {
Expand Down
72 changes: 0 additions & 72 deletions src/docs/jsdoc_home.md

This file was deleted.

5 changes: 3 additions & 2 deletions src/helpers/BasicHelpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* @file BasicHelpers
* @author Adam Brin, Pamela Lam, Alyx Rossetti, Charles Webb, Selina Zawacki
* @category Basic
* @module BasicHelpers
* @category Files
* @description This file contains helpers for working with LinkedArt JSON-LD data
*/

Expand Down Expand Up @@ -84,7 +85,7 @@ export function normalizeAatId(id) {
* @category Basic Helpers
* @description Some of the fields in LinkedArt may be (but sometimes dont) include parts.
* For example, `produced_by` which may have a production, or that production may contain multiple
* parts. This method returns an array with the single or all parts
* parts. This function returns an array with the single or all parts
*
* @param {Object} object - the JSON-LD object (or sub-bart)
* @param {String} field - the field to look for/in
Expand Down
1 change: 1 addition & 0 deletions src/helpers/LanguageHelpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* @file LanguageHelpers
* @category Files
* @author Adam Brin, Pamela Lam, Alyx Rossetti, Charles Webb, Selina Zawacki
* @module LanguageHelpers
* @description This file contains helpers for working with Languages in Linked.art
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/LinkedArtHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file LinkedArtHelpers
* @author Adam Brin, Pamela Lam, Alyx Rossetti, Charles Webb, Selina Zawacki, Nabil Kashyap
* @module LinkedArtHelpers
* @category Files
* @description This file contains helpers for working with LinkedArt JSON-LD data
*/

Expand Down Expand Up @@ -241,6 +242,7 @@ export function getObjectsClassifiedByWithClassification(
/**
* Gets the primary name of the JSON-LD object based on an AAT value or other qualifier, uses the AAT value of Preferred Term as the default
*
* @category Accessors
* @param {Object} submittedResource - the JSON-LD object
* @param {Object} options - additional options
* @param {String|Array} options.requestedClassifications - the requested classifications (default is aat.PRIMARY_TERM)
Expand Down Expand Up @@ -273,6 +275,7 @@ export function getPrimaryName(
/**
* Gets the primary names of the JSON-LD object based on an AAT value or other qualifier, uses the AAT value of Preferred Term as the default
*
* @category Accessors
* @param {Object} submittedResource - the JSON-LD object
* @param {Object} options - additional options
* @param {String|Array} options.requestedClassifications - the requested classifications (default is aat.PRIMARY_TERM)
Expand Down
1 change: 1 addition & 0 deletions src/helpers/ObjectHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file LinkedArtHelpers
* @author Adam Brin, Pamela Lam, Nabil Kashyap
* @module ObjectHelpers
* @category Files
* @description This file contains convenience helpers for working with LinkedArt objects
*/

Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This is the main entrypoint for the module. We import the methods we want to expose
* This is the main entrypoint for the module. We import the functions we want to expose
* from the appropriate helper and then export them as part of the module.
*/
import {
Expand Down

0 comments on commit d6e8c4a

Please sign in to comment.