public class CvocConceptResource extends AbstractAccessibleResource<Concept> implements ParentResource, GetResource, ListResource, UpdateResource, DeleteResource
AbstractAccessibleResource.Handler<E extends Accessible>, AbstractAccessibleResource.NoOpHandler<E extends Accessible>
aclManager, actionManager, AGGREGATION_PARAM, cls, EVENT_TYPE_PARAM, FROM_PARAM, ITEM_ID_PARAM, ITEM_TYPE_PARAM, SHOW_PARAM, TO_PARAM, USER_PARAM
ACCESSOR_PARAM, ALL_PARAM, AUTH_HEADER_NAME, COMMIT_PARAM, CSV_MEDIA_TYPE, DEFAULT_LIST_LIMIT, FILTER_PARAM, graph, GROUP_PARAM, ID_PARAM, INCLUDE_PROPS_PARAM, ITEM_CACHE_TIME, jsonFactory, jsonMapper, LIMIT_PARAM, LOG_MESSAGE_HEADER_NAME, LOG_PARAM, logger, manager, N3_MIMETYPE, OFFSET_PARAM, PATCH_HEADER_NAME, RANGE_HEADER_NAME, RDF_MIMETYPE_FORMATS, RDF_XML_MIMETYPE, request, requestHeaders, RESOURCE_ENDPOINT_PREFIX, SCOPE_PARAM, SORT_PARAM, STREAM_HEADER_NAME, TOLERANT_PARAM, TURTLE_MIMETYPE, uriInfo, VERSION_PARAM
Constructor and Description |
---|
CvocConceptResource(org.neo4j.graphdb.GraphDatabaseService database) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addNarrowerCvocConcept(String id,
List<String> narrower)
Add an existing concept to the list of 'narrower' relations.
|
javax.ws.rs.core.Response |
addRelatedCvocConcept(String id,
List<String> related)
Add a relation by creating the 'related' edge between the two existing
items.
|
javax.ws.rs.core.Response |
createChild(String id,
Bundle bundle,
List<String> accessors)
Create a subordinate resource.
|
void |
delete(String id)
Delete a resource.
|
javax.ws.rs.core.Response |
get(String id)
Fetch a resource by id.
|
javax.ws.rs.core.Response |
getCvocBroaderConcepts(String id)
List broader concepts.
|
javax.ws.rs.core.Response |
getCvocRelatedByConcepts(String id)
List concepts related to another concept.
|
javax.ws.rs.core.Response |
getCvocRelatedConcepts(String id)
List concepts related to another concept.
|
javax.ws.rs.core.Response |
list()
List available resources.
|
javax.ws.rs.core.Response |
listChildren(String id,
boolean all)
List available resources subordinate to this item.
|
javax.ws.rs.core.Response |
removeNarrowerCvocConcept(String id,
List<String> narrower)
Remove a narrower relationship between two concepts.
|
javax.ws.rs.core.Response |
removeRelatedCvocConcept(String id,
List<String> related)
Remove a relation by deleting the edge, not the vertex of the related
concept.
|
javax.ws.rs.core.Response |
update(String id,
Bundle bundle)
Update a resource.
|
createItem, createItem, createItem, deleteItem, deleteItem, exportItemsAsZip, getAccessors, getEventsApi, getItem, listItems, updateItem, updateItem
anonymousApi, api, beginTx, creationResponse, getCacheControl, getCurrentActioner, getCurrentUser, getGraph, getIntQueryParam, getItemUri, getLogMessage, getQuery, getRdfFormat, getRequesterUserProfile, getSerializer, getStringListQueryParam, isPatch, isStreaming, single, streamingList, streamingList, streamingListOfLists, streamingPage, streamingPage, streamingVertexList, streamingVertexList
public CvocConceptResource(@Context org.neo4j.graphdb.GraphDatabaseService database)
public javax.ws.rs.core.Response get(String id) throws ItemNotFound
GetResource
get
in interface GetResource
id
- The requested item idItemNotFound
public javax.ws.rs.core.Response list()
ListResource
The default list limit can be overridden using the limit
parameter, and disabled completely using a value of -1.
Item lists are paginated using the page
parameter.
The page, limit, and total number of items is returned in the Content-Range response header in the form:
page=1; count=20; total=50
If the header X-Stream
is set to true
no count of total items will be performed. This is more efficient when returning large
numbers of items or when limiting is disabled completely.
Example:
curl http://localhost:7474/ehri/[RESOURCE]/list?page=5&limit=10
list
in interface ListResource
public javax.ws.rs.core.Response update(String id, Bundle bundle) throws PermissionDenied, ValidationError, DeserializationError, ItemNotFound
UpdateResource
update
in interface UpdateResource
id
- The resource ID.bundle
- A resource bundle, with or without an ID.PermissionDenied
ValidationError
DeserializationError
ItemNotFound
public void delete(String id) throws PermissionDenied, ItemNotFound, ValidationError
DeleteResource
delete
in interface DeleteResource
id
- The resource ID.PermissionDenied
ItemNotFound
ValidationError
public javax.ws.rs.core.Response listChildren(String id, boolean all) throws ItemNotFound
ParentResource
Example:
curl http://localhost:7474/ehri/[RESOURCE]/[ID]/list
listChildren
in interface ParentResource
ItemNotFound
public javax.ws.rs.core.Response createChild(String id, Bundle bundle, List<String> accessors) throws PermissionDenied, ValidationError, DeserializationError, ItemNotFound
ParentResource
createChild
in interface ParentResource
id
- The parent resource ID.bundle
- A resource bundle.accessors
- The users/groups who can access this item.PermissionDenied
ValidationError
DeserializationError
ItemNotFound
public javax.ws.rs.core.Response addNarrowerCvocConcept(String id, List<String> narrower) throws AccessDenied, PermissionDenied, ItemNotFound
id
- the item IDnarrower
- the narrower item IDsAccessDenied
PermissionDenied
ItemNotFound
public javax.ws.rs.core.Response removeNarrowerCvocConcept(String id, List<String> narrower) throws PermissionDenied, AccessDenied, ItemNotFound
id
- the item IDnarrower
- the narrower item IDsPermissionDenied
AccessDenied
ItemNotFound
public javax.ws.rs.core.Response getCvocBroaderConcepts(String id) throws ItemNotFound, AccessDenied
id
- The item IDItemNotFound
AccessDenied
public javax.ws.rs.core.Response getCvocRelatedConcepts(String id) throws ItemNotFound
id
- The item IDItemNotFound
public javax.ws.rs.core.Response getCvocRelatedByConcepts(String id) throws ItemNotFound
id
- The item IDItemNotFound
public javax.ws.rs.core.Response addRelatedCvocConcept(String id, List<String> related) throws AccessDenied, PermissionDenied, ItemNotFound
id
- the item IDrelated
- the related item IDsAccessDenied
PermissionDenied
ItemNotFound
public javax.ws.rs.core.Response removeRelatedCvocConcept(String id, List<String> related) throws AccessDenied, PermissionDenied, ItemNotFound
id
- the item IDrelated
- the related item IDAccessDenied
PermissionDenied
ItemNotFound
Copyright © 2018 The European Holocaust Research Infrastructure (EHRI). All rights reserved.