Skip to content

Commit

Permalink
cleanup of labels and css
Browse files Browse the repository at this point in the history
  • Loading branch information
abrin committed Jun 2, 2022
1 parent 2f76d63 commit 3bcdd75
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 18 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
[Docs](http://linkedartjs.org/) |
[Contributing](https://github.com/thegetty/linkedart.js/blob/master/.github/CONTRIBUTING.md)

## What is Linked.Art?
## What is LinkedArt?

Linked.Art is a Linked Open Data model which is used to describe cultural heritage materials. Much more information about the model, and the community that is building it, can be found at [https://linked.art/](https://linked.art/)
LinkedArt is a Linked Open Data model which is used to describe cultural heritage materials. Much more information about the model, and the community that is building it, can be found at [https://linked.art/](https://linked.art/)

## What is the LinkedArt.js Library?

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 Linked.Art source. This library includes different types of functions or methods:
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 Functions_: for things like getting the Title, Name, Identifier, or other common properties from a Linked.Art Object. Please see the helpers, or examples in our tests.
- _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.

## Why did we create this?
Expand All @@ -26,13 +26,13 @@ This project evolved out of Getty's implementation of the [Research Collections

## How Does it Work?

The library includes a number of methods or helpers for working with Linked.Art’s basic JSON-LD patterns.
The library includes a number of methods or helpers for working with LinkedArt’s basic JSON-LD patterns.

### Simple Helpers for Simple Functions

While we cannot imagine every possible use, we've created some simple helpers to facilitate the request of common data fields (Title, Name, Accession #, Description, Materials, Cultures, Dimensions, Rights Statements, and Images, for example).

Note, full examples of many of these functions are available by browsing the "specs" folder in the source, or in the JSDoc.
Note, full examples of many of these functions are available by browsing the "[specs](https://github.com/thegetty/linkedart.js/tree/main/src/specs)" folder in the source, or the links on the left of [this page](https://www.linkedartjs.org).

#### Example: Find the Title of this Record

Expand Down Expand Up @@ -213,13 +213,13 @@ let objects = getObjectsClassifiedAsWithClassification(

### Working with Languages

You can do basic things like getting values based on a classification or set of classifications, as well as more advanced tasks like working with languages and other elements of the Linked.Art model. Almost every function can be passed a `language` attribute to filter on the language returned.
You can do basic things like getting values based on a classification or set of classifications, as well as more advanced tasks like working with languages and other elements of the LinkedArt model. Almost every function can be passed a `language` attribute to filter on the language returned.

Want to know more, take a look at the [examples below](#getting started).

## More Examples & Documentation

The links on the left will take you to detailed documentation for each of the methods in this library. Furthermore, the [specs](https://github.com/thegetty/linkedart.js/tree/main/src/specs) folder in the source repository shows some practical examples using data from the community.
The links on the left of [this page](https://www.linkedartjs.org) will take you to detailed documentation for each of the methods in this library. Furthermore, the [specs](https://github.com/thegetty/linkedart.js/tree/main/src/specs) folder in the source repository shows some practical examples using data from the community.

## What this Library doesn't do

Expand All @@ -229,11 +229,11 @@ To that end, this library does not make HTTP requests or attempt to resolve link

## Contributing

We know this library does not include every use-case, or a simple helper for accessing every Linked.Art property. We’d love feedback or pull-requests to continue to broaden and deepen the library to better support the community.
We know this library does not include every use-case, or a simple helper for accessing every LinkedArt property. We’d love feedback or pull-requests to continue to broaden and deepen the library to better support the community.

## What Do I Need to Use It?

You will need to be comfortable with javascript and npm (Node Package Manager). You will also need data that is formatted to the Linked.Art model. Example sets you can work with can be found at [https://linked.art/cookbook/](https://linked.art/cookbook/)
You will need to be comfortable with javascript and npm (Node Package Manager). You will also need data that is formatted to the LinkedArt model. Example sets you can work with can be found at [https://linked.art/cookbook/](https://linked.art/cookbook/)

## How do I install it?

Expand All @@ -245,7 +245,7 @@ $ npm install @thegetty/linkedart.js --save

## Getting Started

Below is a simple example of how to use the LinkedArt library, for more examples, please see the tutorials [Understanding Linked Art](https://observablehq.com/@jrladd/linked-art-1), [Working with Linked Art](https://observablehq.com/@jrladd/linked-art-2), [Exploring Linked Art](https://observablehq.com/@jrladd/linked-art-3) for using Linked.Art with the Getty Museum’s linked open data APIs.
Below is a simple example of how to use the LinkedArt library, for more examples, please see the tutorials [Understanding Linked Art](https://observablehq.com/@jrladd/linked-art-1), [Working with Linked Art](https://observablehq.com/@jrladd/linked-art-2), [Exploring Linked Art](https://observablehq.com/@jrladd/linked-art-3) for using LinkedArt with the Getty Museum’s linked open data APIs.

### A Simple Example to get the title of an object:

Expand Down
2 changes: 1 addition & 1 deletion jsdoc-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"source": {
"include": ["src/helpers/"]
},
"plugins": ["plugins/markdown"],
"plugins": ["plugins/markdown", "node_modules/better-docs/category"],
"templates": {
"cleverLinks": false,
"monospaceLinks": false,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "npm run clean:dist && rollup -c build/rollup.config.js",
"clean:dist": "rm -Rrf ./dist",
"clean": "del ./dist",
"build:jsdoc": "node node_modules/jsdoc/jsdoc.js -c jsdoc-config.json; cp src/docs/style.css jsdoc/",
"build:jsdoc": "node node_modules/jsdoc/jsdoc.js -c jsdoc-config.json ; cp src/docs/style.css jsdoc/",
"lint": "prettier --check 'src/**/*.js'",
"lint:fix": "prettier -w 'src/**/*.js'",
"prepublishOnly": "rollup -c build/rollup.config.js"
Expand Down
9 changes: 9 additions & 0 deletions src/docs/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* make the links to the code clearer to read*/
p.tag-source span a {
color: black;
}

/* hide the subcategories which label things as modules, that aren't */
.category h3 {
display: none;
}
8 changes: 6 additions & 2 deletions src/helpers/BasicHelpers.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @file BasicHelpers
* @author Adam Brin, Pamela Lam, Alyx Rossetti, Charles Webb, Selina Zawacki
* @module BasicHelpers
* @description This file contains helpers for working with linked.art JSON-LD data
* @category Basic
* @description This file contains helpers for working with LinkedArt JSON-LD data
*/

import { PART } from "../data/constants.json";
Expand All @@ -12,6 +12,7 @@ import { PART } from "../data/constants.json";
* an empty array (if it doesn't exist), an array with the single object if it's an object
* or primitive, or the array
*
* @category Basic Helpers
* @param {Object} obj - The object that might have an array attribute
* @param {String} key - The key for the attribute field we want to retrieve
*
Expand Down Expand Up @@ -47,6 +48,7 @@ export function normalizeFieldToArray(obj, key) {
/**
* Normalizes the AAT ID to one of two versions (an aat: prefixed id or a full url)
*
* @category Basic Helpers
* @param {String} id - an ID to test
*
* @example - short to full aat value
Expand Down Expand Up @@ -79,6 +81,7 @@ export function normalizeAatId(id) {
/**
* Normalize a field that may have parts.
*
* @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
Expand Down Expand Up @@ -119,6 +122,7 @@ export function normalizeFieldWithParts(object, field) {
* Checks whether the JSON-LD object has unique fields outside of some basic fields (id, type, _label). Useful for testing whether
* we should include the parent part in a list or not
*
* @category Basic Helpers
* @param {Object} object - the JSON-LD object to check
* @param {Array} fieldsToIgnore - a list of fields to ignore when checking
* @private
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/LinkedArtHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file LinkedArtHelpers
* @author Adam Brin, Pamela Lam, Alyx Rossetti, Charles Webb, Selina Zawacki, Nabil Kashyap
* @module LinkedArtHelpers
* @description This file contains helpers for working with linked.art JSON-LD data
* @description This file contains helpers for working with LinkedArt JSON-LD data
*/

import { doesObjectLanguageMatch } from "./LanguageHelpers";
Expand Down Expand Up @@ -508,7 +508,7 @@ export function getValueOrContent(object) {
}

/**
* Gets all the values of objects in a Linked Art object's 'referred_to_by' field
* Gets all the values of objects in a LinkedArt object's 'referred_to_by' field
* which are classified by the classification parameter.
*
* @param {Object} object - the Actor object to inspect
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/ObjectHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file LinkedArtHelpers
* @author Adam Brin, Pamela Lam, Nabil Kashyap
* @module ObjectHelpers
* @description This file contains convenience helpers for working with linked.art objects
* @description This file contains convenience helpers for working with LinkedArt objects
*/

import {
Expand Down

0 comments on commit 3bcdd75

Please sign in to comment.