Class: ResourceMapNormalization

ResourceMapNormalization()

new ResourceMapNormalization()

Find the Resource Map document and package aggregation in imported RDF, then apply only repairs whose values are certain. Configured endpoint URIs are converted only when their identifier claims agree.
Since:
  • 2.39.0
Source:

Methods

getEndpointPidForNormalization(subject) → {string|null}

Read a configured URL's PID when all its identifiers match. A destination node may have no identifiers.
Parameters:
Name Type Description
subject NamedNode | BlankNode RDF node to check
Since:
  • 2.41.0
Source:
Returns:
PID if the node can be used, otherwise null
Type
string | null

normalizeEndpointUrls(nodesopt) → {Map.<string, string>}

Use configured CN resolve URLs for identified MN/CN nodes. For example, `/object/urn%3Auuid%3Aabc` becomes `/resolve/urn:uuid:abc`; the PID stays `urn:uuid:abc`. Include nodes outside the package and merge matching PIDs.
Parameters:
Name Type Attributes Description
nodes Array.<NamedNode> <optional>
Limit conversion to these nodes. By default, inspect every node with an identifier statement
Since:
  • 2.41.0
Source:
Returns:
Old node URLs mapped to resolver URLs
Type
Map.<string, string>

repairImportedGraph(identity, recoveredFromInverseopt)

After all original PID claims have been validated, add only missing or equivalent statements whose intended values are certain. Convert eligible configured endpoint URIs to CN resolver URLs.
Parameters:
Name Type Attributes Default Description
identity object Raw identity inspection from validation
recoveredFromInverse boolean <optional>
false Whether the Resource Map and aggregation were found through one exact `ore:isDescribedBy` statement
Source:

synchronizeCoreGraph(memberDescriptors)

Ensure a valid Resource Map has the required map, aggregation, and membership statements in both directions for its current exact members.
Parameters:
Name Type Description
memberDescriptors Array.<{pid:string, uri:string}> Exact members
Source:

selectImportedRoot(graph, resourceMapPid, endpointsopt) → {Object}

Identify exactly one Resource Map and package aggregation in imported RDF. Reject ambiguous candidates instead of ranking them, and do not edit the graph.
Parameters:
Name Type Attributes Description
graph RDFGraph Imported RDF graph
resourceMapPid string Outer Resource Map PID
endpoints object <optional>
Configured resolve and object service URLs used to read URL-valued map identifiers when checking the reverse link
Source:
Returns:
Selected Resource Map and aggregation
Type
Object

ResourceMapNormalization(options)

new ResourceMapNormalization(options)

Create a normalization helper for one ResourceMap.
Parameters:
Name Type Description
options object Normalization options
Properties
Name Type Description
resourceMap ResourceMap Resource Map being normalized
Source:

Methods

getEndpointPidForNormalization(subject) → {string|null}

Read a configured URL's PID when all its identifiers match. A destination node may have no identifiers.
Parameters:
Name Type Description
subject NamedNode | BlankNode RDF node to check
Since:
  • 2.41.0
Source:
Returns:
PID if the node can be used, otherwise null
Type
string | null

normalizeEndpointUrls(nodesopt) → {Map.<string, string>}

Use configured CN resolve URLs for identified MN/CN nodes. For example, `/object/urn%3Auuid%3Aabc` becomes `/resolve/urn:uuid:abc`; the PID stays `urn:uuid:abc`. Include nodes outside the package and merge matching PIDs.
Parameters:
Name Type Attributes Description
nodes Array.<NamedNode> <optional>
Limit conversion to these nodes. By default, inspect every node with an identifier statement
Since:
  • 2.41.0
Source:
Returns:
Old node URLs mapped to resolver URLs
Type
Map.<string, string>

repairImportedGraph(identity, recoveredFromInverseopt)

After all original PID claims have been validated, add only missing or equivalent statements whose intended values are certain. Convert eligible configured endpoint URIs to CN resolver URLs.
Parameters:
Name Type Attributes Default Description
identity object Raw identity inspection from validation
recoveredFromInverse boolean <optional>
false Whether the Resource Map and aggregation were found through one exact `ore:isDescribedBy` statement
Source:

synchronizeCoreGraph(memberDescriptors)

Ensure a valid Resource Map has the required map, aggregation, and membership statements in both directions for its current exact members.
Parameters:
Name Type Description
memberDescriptors Array.<{pid:string, uri:string}> Exact members
Source:

selectImportedRoot(graph, resourceMapPid, endpointsopt) → {Object}

Identify exactly one Resource Map and package aggregation in imported RDF. Reject ambiguous candidates instead of ranking them, and do not edit the graph.
Parameters:
Name Type Attributes Description
graph RDFGraph Imported RDF graph
resourceMapPid string Outer Resource Map PID
endpoints object <optional>
Configured resolve and object service URLs used to read URL-valued map identifiers when checking the reverse link
Source:
Returns:
Selected Resource Map and aggregation
Type
Object