Term API

From TeamServer ER/Studio
Jump to: navigation, search

Go Up to API Reference

This part of the Team Server API lets you work with terms.

GET

GET v1/businessglossaries/<glossary id>/businessterms

Obtains a list of terms related to the glossary with the specified ID. See Glossary API.

If successful, the response from the server provides a list of terms with details about each one of them.

GET v1/businessglossaries/<glossary id>/childrenbusinessterms

Obtains a list of terms and their children related to the glossary with the specified ID. See Glossary API.

Use the following parameters for this request:

  • q (optional)
    Filters Term names by provided query value.
  • alphaFilter (optional)
    Filters name starting with the provided letter [A-Z].
  • limit (default value = 25)
  • offset (default value = 0)
  • fields (optional)
  • searchInDescription (default value = 0)
    Valid values include 1.

If successful, the response from the server provides a list of terms.

GET v1/businessterms

Obtains a list of terms.

If successful, the response from the server provides a list of terms with details about each one of them.

GET v1/businessterms/<id>

Obtains information about the term with the specified ID.

GET v1/businessterms/<termId>/managedattributes

Obtains a list of managed attributes related to the term with the specified ID.

If successful, the response from the server provides a list of managed attributes with details about each one of them.

GET v1/businessterms/relatedterms/search

Searches all related Terms using the following parameters:

  • termId
  • page (default value = 0)
    Value must be greater than or equal to 0.
  • pageSize (default value = 25)
    Value must be greater than or equal to 0.
  • relationType
    Valid values include [TYPE_PARENT, TYPE_CHILDREN, ATTRIBUTE_PARENT, ATTRIBUTE_CHILDREN, SYNONYM, RELATED]]

If successful, the return results in a list of Terms. If relationType is RELATED, the Term results also contain relation details including, forwardRelationName, reverseRelationName, fromMultiplicity, and toMultiplicity.

POST

POST v1/businessterms

Creates a term. Your request must provide the following fields:

  • name
  • description (optional)
  • status (optional)
  • abbreviations (optional)
  • aliases (optional)
  • userData (optional)
  • stewards (optional)
    Note: You only need to specify either the ID or the name of each steward. For example: { "name": "jane" }

If successful, the response from the server provides all the details about your new term.

POST v1/businessterms/relatealltermswithproperties

Relates all Business Terms with properties using the following parameters:

  • termId1
  • relationType
    Valid values include [TYPE_PARENT, TYPE_CHILDREN, ATTRIBUTE_PARENT, ATTRIBUTE_CHILDREN, SYNONYM, RELATED]]
  • query
    Filters term names by provided query value.
  • azfilter
    Filters name starting with the provided letter [A-Z].

If successful, the return results { "result": "ok", "count": "<count of terms with whom relation is created>"}.

POST v1/businessterms/relatetermsbytype

Relates the Terms with the specified types using the following parameters:

  • termId1
  • termId2
  • relationType
    Valid values include [TYPE_PARENT, TYPE_CHILDREN, ATTRIBUTE_PARENT, ATTRIBUTE_CHILDREN, SYNONYM]]

If successful, the response is JSON containing the result with same format as 1.

POST v1/businessterms/relatetermswithproperties

Relates Business Terms with properties using the following parameters:

  • termId1
  • termId2
  • forwardRelationName
  • reverseRelationName
  • fromMultiplicity
    Valid values include [ONLY_ONE, ZERO_OR_ONE, ZERO_ONE_OR_MANY, ONE_OR_MANY]
  • toMultiplicity
    Valid values include [ONLY_ONE, ZERO_OR_ONE, ZERO_ONE_OR_MANY, ONE_OR_MANY]
  • flipDirection (optional)
    If TRUE, will create a relation from termId2 to termId1.

If successful, the return results { "result": "ok" }.

PUT

PUT v1/businessterms/<id>

Updates the information of a term. Your request can provide any combination of the following fields:

  • name
  • description
  • status
  • abbreviations
  • aliases
  • userData
  • stewards
    Note: You only need to specify either the ID or the name of each steward. For example: { "name": "jane" }

If successful, the response from the server provides all the details about your modified term.

PUT v1/businessterms/<termId>/managedattributes

Updates the managed attribute values of a term. The format for the different value types of attributes include:

  • Boolean. Valid values are: { null, " ", "True", "False" }
  • Date. Valid format (month/date/year - mm/dd/yyyy). Valid value formats are: { null, " ", "05/24/1994" }
  • Numeric. Should contain only numbers, ex. 1334532. Valid value formats are: { null, " ", "788445568" }
  • Text. This can contain any text value. Valid values formats are: { null, " ", "some text for example"}
  • Time. Valid format (hour:minute am/pm marker - hh:mm a), ex. 02:25 AM. Valid values formats are: { null, " ", "02:25 AM"}
  • Text List. This is like a drop-down option and any of the valid option values should be entered, ex. If valid options are {"t1", "t2"}, any one of the two should be given or null or empty value (" ").

If successful, the response from the server provides all the managed attributes for your term.

PUT v1/businessterms/updatetermrelationswithproperties

Updates the related terms with properties. The format for the different value types of attributes include:

  • termRelationId
  • termId1
    This value must match the existing termId1 of the relation identified by termRelationId.
  • temrId2
    This value must match the existing termId2 of the relation identified by termRelationId.
  • forwardRelationName
  • reverseRelationName
  • fromMultiplicity
    Valid values include [ONLY_ONE, ZERO_OR_ONE, ZERO_ONE_OR_MANY, ONE_OR_MANY].
  • toMultiplicity
    Valid values include [ONLY_ONE, ZERO_OR_ONE, ZERO_ONE_OR_MANY, ONE_OR_MANY].
  • flipDirection
    Use to flip the relation direction.

If successful, the response is JSON containing the result with same format as 1.

DELETE

DELETE v1/businessterms/<id>

Deletes the term with the specified ID. If successful, the response is {"message":"OK","status":"200"}.

DELETE v1/businessterms/unrelatealltermswithproperties

Unrelates all Business Terms with properties using the following parameters:

  • termId1
  • relationType
    Valid values include [TYPE_PARENT, TYPE_CHILDREN, ATTRIBUTE_PARENT, ATTRIBUTE_CHILDREN, SYNONYM, RELATED]]
  • query
    Filters term names by provided query value.
  • azfilter
    Filters name starting with the provided letter [A-Z].

If successful, the return results { "result": "ok", "count": "<count of terms with whom relation is created>"}.

DELETE v1/businessterms/unrelatetermsbytype

Unrelates the terms with the specified types using the following parameters:

  • termId1
  • termId2
  • relationType
    Valid values include [TYPE_PARENT, TYPE_CHILDREN, ATTRIBUTE_PARENT, ATTRIBUTE_CHILDREN, SYNONYM]]

If successful, the response is JSON containing the result with same format as 1.

DELETE v1/businessterms/unrelatetermswithproperties

Unrelates the terms with the specified IDs using the following parameters:

  • termId1
  • termId2
  • termRelationId

If successful, the response is JSON containing the result with same format as 1.

Term Fields

Term resources in Term API requests and responses can include any combination of the following fields:

Item Example Description

"id"

16

An integer that uniquely identifies the term.

"status"

"In progress"

A string that defines the status of the term using nomenclature you decide upon.

"description"

"Application protocol for distributed, collaborative hypermedia information systems."

A description of the term.

"createdAt"

1372150068

The date when the term was created, in Unix time (seconds since 1970).

"link"

"/term/view.spg?termKey=16"

Path relative to the Team Server root URL that points to the page of the term.

For example, if the Team Server root URL is http://teamserver.example.com , the example value here determines that you can access the page of the term at http://teamserver.example.com/term/view.spg?termKey=16 .

"name"

"Hypertext Transfer Protocol"

The name of the term.

"userData"

"You can write anything here."

Additional information about the business object.

"type"

"Term"

The type of the resource. Its value is always "Term" for term resources.

"aliases"

A list of aliases and synonyms of the term.

"abbreviations"

"HTTP"

A list of abbreviations of the term.

"stewards"

[ { "id": "2", "name": "jane", "type": "person", "url": "/v1/people/2" }, // … ]

A list of people that are stewards of the term.

Each person entry provides the following fields:

  • id
  • name
  • type
  • url

"url"

"/v1/businessterms/16"

Path relative to the Team Server root API URL that points to the entry of the term resource.

For example, if the Team Server root API URL is http://teamserver.example.com/api , the example value here determines that you can access the term resource at http://teamserver.example.com/api/v1/businessterms/16 .

Example Response

This is an example response from a GET v1/businessterms call:

{
    "metadata_": {
        "limit": 25,
        "totalCount": 2,
        "offset": 0
    },
    "businessterms": [
        {
            "id": 13,
            "status": "Final",
            "description": "Network protocol to transfer files between computers over a TCP-based network.",
            "createdAt": 1372151100,
            "link": "/term/view.spg?termKey=13",
            "name": "File Transfer Protocol",
            "userData": "",
            "type": "Term",
            "aliases": "",
            "abbreviations": "FTP",
            "stewards": [
                {
                    "id": "2",
                    "name": "jane",
                    "type": "person",
                    "url": "/v1/people/2"
                }
            ],
            "url": "/v1/businessterms/13"
        },
        {
            "id": 12,
            "status": "Final",
            "description": "Application protocol for distributed, collaborative hypermedia information systems.",
            "createdAt": 1372150068,
            "link": "/term/view.spg?termKey=12",
            "name": "Hypertext Transfer Protocol",
            "userData": "",
            "type": "Term",
            "aliases": "",
            "abbreviations": "HTTP",
            "stewards": [
                {
                    "id": "2",
                    "name": "jane",
                    "type": "person",
                    "url": "/v1/people/2"
                }
            ],
            "url": "/v1/businessterms/12"
        }
    ]
}

This is from a GET v1/businessterms/<id> call:

{
    "businessterm": {
        "id": 13,
        "status": "Final",
        "description": "Network protocol to transfer files between computers over a TCP-based network.",
        "createdAt": 1372151100,
        "link": "/term/view.spg?termKey=13",
        "name": "File Transfer Protocol",
        "userData": "",
        "type": "Term",
        "aliases": "",
        "abbreviations": "FTP",
        "stewards": [
            {
                "id": "2",
                "name": "jane",
                "type": "person",
                "url": "/v1/people/2"
            }
        ],
        "url": "/v1/businessterms/13"
    }
}

See Also