Gabriela Kuhn
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # API's for Search Thing by term This is just related to Search API's for this page ![image](https://hackmd.io/_uploads/S1LGXNVK6.png) I separate it for itens: - SUGGESTION: My suggestions according to documentations and research about Restful API’s - MODIFY: API that is already there but the returns need to be modified to add more information. - CREATE: API’s that need to be create. ## SUGGESTION: Lowercase the API's Suggestion: Endpoint lowercase: by RESTFULL API rules better be everthing in an api lowercase example ```/things/search/:offset/:searchterm``` ## SUGGESTION: Responses For all Search related API's we need the responses. But I think you are alredy doing/did this. - 200: Successful response - 204: No content - Successful response - 400: Invalid or missing parameters - 404: No found api with the provided parameters - 500: Internal Server Error ## MODIFY: GET: Search things by offset and search term This API is done but we need to **add** more info to the json return. - Returns an array with things for the search term and an offset to specify the starting point from which results should be retrieved. - Endpoint: ```/things/search/:offset/:searchterm``` ### Return JSON for the object inside the array In thie API we need to add ```id, association, keywords, contributors``` fo the JSON. (The *** it means that the value need to be added in the API, the rest is alredy there.) ```json [{ "thingid": "https://repository.tudelft.nl/Thing_0026f5ff-8f06-4bd7-92aa-503eeb7955f5", "title": "Possibilities, Intentions and Threats", "sub_title": "Dual Use in the Life Sciences Reconsidered", "description": "description ", "object_type": "journal article", "Year of publictation": "year of publications in the journal", "date_created": "2016-04-25 13:21:21.666000", "date_modified": "2019-10-01 14:58:07.520000", "embargo": "", "access_type": "", "access_value": "© 2011 Van der Bruggen, K.; This article is published with open access at Springerlink.com", "***id": "Thing_0026f5ff-8f06-4bd7-92aa-503eeb7955f5", // this is the thingid without https://repository.tudelft.nl/ "***organization": { "Faculty": "TU Delft", "Department": "Industrial Design" "ResearchGroup": "Sustainable Materials" } "***keywords": "ARRAY IN SUBJECTS", "***contributors": [ { "index": "0", "contributor_role": "author", "person": "Person_7f871638-d510-4703-9028-4be4ff75723a", "name_part": "K.", "first_name": "K.", "last_name": "Van der Bruggen", "things": [ "Thing_0026f5ff-8f06-4bd7-92aa-503eeb7955f5" ], "***affiliation": // here we need to bring the assocuiation for each person (if the person has before 2016 the repo don't have ths info) { "Faculty": "TU Delft", "Department": "Aerospace Engineering", "ResearchGroup": "Planetary Exploration" } }, { "index": "0", "contributor_role": "author", "person": "Person_7f871638-d510-4703-9028-4be4ff75723a", "name_part": "K.", "first_name": "K.", "last_name": "Another name", "things": [ "Thing_0026f5ff-8f06-4bd7-92aa-503eeb7955f5" ], "***affiliation": { "Faculty": "TU Delft", "Department": "Aerospace Engineering", "ResearchGroup": "Air Transport & Operations" } } ] }], ``` #### Explanation for departments: We need to bring the association/department here, so departments will be an object as followed: ``` { "Faculty" : "TU Delft", "Department" : "Industrial Design" "ResearchGroup": "Sustainable Materials" } ``` Might be the record does not have this info, or have it partially. In case partially brings the info that we have available: ``` { "Faculty" : "TU Delft", "Department" : "Industrial Design" } ``` In case empty, bring an empty object: `{}` #### Explanation for contributors: We need to bring contributors, but is also inportant that we add association for each contributors in this return ``` "contributors": [ { "index": "0", "contributor_role": "author", "person": "Person_7f871638-d510-4703-9028-4be4ff75723a", "name_part": "K.", "first_name": "K.", "last_name": "Van der Bruggen", "things": [ "Thing_0026f5ff-8f06-4bd7-92aa-503eeb7955f5" ], "association": { "Faculty": "TU Delft", "Department": "Aerospace Engineering", "ResearchGroup": "Planetary Exploration" } }, ``` Not all person has this info. For persons before 2016 the repo do not have this info so we bring association as an empty object. ``` "contributors": [ { "index": "0", "contributor_role": "author", "person": "", "name_part": "K.", "first_name": "K.", "last_name": "Van der Bruggen", "things": [ "Thing_0026f5ff-8f06-4bd7-92aa-503eeb7955f5" ], "association": {} }, ``` ## CREATE: API's for count by filter Here we have two options Create a ```Unified API for counts``` OR create a ```API's for count by filter``` The unified APIwill be responsible to bring all counts for a serch term and an unique json format. We also can have separate API's for count for each filter (API's for count by filter). I dont kno which of the two option makes more sense in term of perfomance, but we need the information of the count every time we do a serach term, so if we do separate we need to call all apis every time. Thus I think makes more sense to have an unified one. This is the image of the filter menu where we will need the the json with the counts : ![image](https://hackmd.io/_uploads/r1rfR7NYT.png) ### Unified API for counts One API that brings all the counts: - GET: Number of and Keywords in search term results - GET: Number of things in Embargo in a search term results - GET: Number of things metadataOnly in a search term results - GET: Number of things openAccess in a search term results - GET: Number of languages present in search term results - GET: Number of Object Types present in search term results **Endpoint** - Endpoint:``` /things/search/count/{searchTerm}``` - Usage: ```/things/search/count/computer``` **Response Format** ```json { "keywords": [ { "word": "computer", "count": 25 }, { "word": "technology", "count": 15 }, { "word": "software", "count": 8 }, { "word": "hardware", "count": 5 } ], "embargoCount":2, "metadataOnlyCount":2, "openAccessCount":2, "languages": [ { "language": "en", "count": 2 }, { "language": "nl", "count": 5 }, ] "objectTypes": [ { "objectType": "Journal", "count": 2 }, { "objectType": "books", "count": 5 }, ] ``` ### API's for count by filter **OR** we can go with one API for count by filter, if so, as the folowed.... ### Keywords #### GET: NUmber of and Keywords in search term results - Returns: List of keywords present in the search results along with their counts (how many things has that word in their keywords). - Endpoint: ```/things/search/keyword/count/{searchTerm}``` - Example Usage: ```/things/search/keyword/count/computer``` **Response format** ```json "keywords": [ { "word": "computer", "count": 25 }, { "word": "technology", "count": 15 }, { "word": "software", "count": 8 }, { "word": "hardware", "count": 5 } ] ``` ### Embargo #### GET: Number of things in Embargo in a search term results - Returns the Number of records under embargo present in the search results. - Endpoint: ```/things/search/embargo/count/{searchTerm}``` - Example Usage: ```/things/search/embargo/count/computer``` ```json { "embargoCount":2 } ``` ### Metadata only Metadata only is the list of records without any file (metadataOnly)in the search results. #### GET: Number of things metadataOnly in a search term results - Returns the Number of records without files present in the search results. - Endpoint: ```/things/search/metadataOnly/count/{searchTerm}``` - Example Usage: ```/things/search/metadataOnly/count/computer``` ```json { "metadataOnlyCount": 4 } ``` ### Open Access Open Access are records with files that are not under embargo. #### GET: Number of things openAccess in a search term results - Returns the Number of things with files and not under embargo - Endpoint: ```/things/search/openAccess/count/{searchTerm}``` - Example Usage: ```/things/search/openAccess/count/computer``` ```json { "openAccessCount": 1 } ``` ### Languages #### GET: Number of languages present in search term results - Returns the Number of things under a certain language in the search results along with the language itself - Endpoint: ```/things/search/language/count/{searchTerm}``` - Example Usage: ```/things/search/language/count/computer``` ```json "languages": [ { "language": "en", "count": 2 }, { "language": "nl", "count": 5 }, ] ``` ### Object Type #### GET: Number of Object Types present in search term results - Returns the Number of things under a certain object types in the search results along with the object types itself - Endpoint: ```/things/search/objectType/count/{searchTerm}``` - Example Usage: ```/things/search/objectType/count/computer``` ```json "objectTypes": [ { "objectType": "Journal", "count": 2 }, { "objectType": "books", "count": 5 }, ] ``` ## CREATE: API's for list by filter ### Keywords #### GET: List of things with thta keywords in search term results - Returns: List of things by keywords present in the search results. - Endpoint: ```/things/search/keyword/{offset}/{searchTerm}/{keyword}``` - Example Usage: ```/things/search/keyword/10/computer/technology``` **Response format** Same response format json of ```/Thing/Search/{offset}/{searchterm})``` ```json [ {"thig object 01"}, {"thig object 01"} ] ``` ### Embargo #### GET: List of things under Embargo in search term results - Returns a List of records under embargo present in the search results. - Endpoint: ```/things/search/embargo/{offset}/{searchTerm}``` - Example Usage: ```/things/search/embargo/10/computer``` **Response format** Same response format json of ```/Thing/Search/{offset}/{searchterm})``` ```json [ {"thig object 01"}, {"thig object 01"} ] ``` ### Metadata only Metadata only is the list of records without any file (metadataOnly)in the search results. #### GET: Number of things metadataOnly in a search term results - Returns the Number of records without files present in the search results. - Endpoint: ```/things/search/metadataOnly/count/{searchTerm}``` - Example Usage: ```/things/search/metadataOnly/count/computer``` ```json { "metadataOnlyCount": 4 } ``` #### GET: List of things metadataOnly in search term results - Returns a List of records under embargo present in the search results. - Endpoint: ```/things/search/metadataOnly/{offset}/{searchTerm}``` - Example Usage: ```/things/search/metadataOnly/10/computer``` **Response format** Same response format json of ```/Thing/Search/{offset}/{searchterm})``` ```json [ {"thig object 01"}, {"thig object 01"} ] ``` ### Open Access Open Access are records with files that are not under embargo. #### GET: List of things openAccess in search term results - Returns a List of things with files and not under embargo . - Endpoint: ```/things/search/openAccess/{offset}/{searchTerm}``` - Example Usage: ```/things/search/openAccess/10/computer``` **Response format** Same response format json of ```/Thing/Search/{offset}/{searchterm})``` ```json [ {"thig object 01"}, {"thig object 01"} ] ``` ### Languages #### GET: List of things under a certain langage in search term results - Returns a List of things with files and not under embargo . - Endpoint: ```/things/search/language/{offset}/{searchTerm}/{language}``` - Example Usage: ```/things/search/language/10/computer/nl``` **Response format** Same response format json of ```/Thing/Search/{offset}/{searchterm})``` ```json [ {"thig object 01"}, {"thig object 01"} ] ``` ### Object Type #### GET: List of things under a certain objectType in search term results - Returns a List of things with files and not under embargo . - Endpoint: ```/things/search/objectType/{offset}/{searchTerm}/{objectType}``` - Example Usage: ```/things/search/objectType/10/computer/books``` **Response format** Same response format json of ```/Thing/Search/{offset}/{searchterm})``` ```json [ {"thig object 01"}, {"thig object 01"} ] ``` ### Data Range #### GET: Things by date range in Search term results - Returns a List of things with files and not under embargo . - Endpoint: /things/search/dateRange/{offset}/{searchTerm}/{startDate}/{endDate} - Example Usage: /things/search/dateRange/10/computer/2022-01-01/2022-12-31 **Response format** Same response format json of ```/Thing/Search/{offset}/{searchterm})``` ```json [ {"thig object 01"}, {"thig object 01"} ] ``` ## SUGGESTION: Modify API for GET Number of total things by search term I suggest to modify this to follow the same pattern of counts API's. Currently it is the API ``` /Thing/SearchTotal/{searchterm}``` - Returns total number Things that contain searchterm - Suggested Endpoint: ```/things/search/count/{searchTerm}``` - Example Usage: ```/things/search/count/computer```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully