objectMapperService
sparql
Service for transforming SPARQL results into more manageable objects.
The service can be extended via prototype inheritance by re-implementing
any of the methods. The most likely candidates for re-implementation are
makeObject
, reviseObject
, and postProcess
.
The methods for using the service are makeObjectList
, and makeObjectListNoGrouping
.
Merges two objects.
Param | Type | Details |
---|---|---|
first | Object | An object as returned by makeObject. |
second | Object | The object to merge with the first. |
Object | The merged object. |
Add the given value to the given list, merging an object value to and object in the list if both have the same id attribute. A value already present in valueList is discarded.
Param | Type | Details |
---|---|---|
valueList | Array | A list to which the value should be added. |
value | Object | The value to add to the list. |
Array | The merged list. |
Provides a hook for revising an object after it has been processed by makeObject. The defaul implementation is a no-op.
Param | Type | Details |
---|---|---|
obj | Object | A single object as returned by makeObject. |
original | Object | A single SPARQL result row object. |
Object | The revised object. |