REST Interface Description
Note: You should only use the here described add functionality if you are absolutely certain the submitted concepts do not dupliate existing concepts.
Add a single concept
You can add a single concept by making a POST request to the following URL:
http://[server.url]/conceptpower/rest/concept/add
You define the values of the concept you want to add in JSON format:
{
"word":"kitty",
"pos": "noun",
"conceptlist":"mylist",
"description":"Soft kitty, sleepy kitty, little ball of fur.",
"type":"LivingBeing"
}
You can use the following attributes:
- word (required): the name of the concept
- pos (required): the part of speach of the concept. Should be one of the following: noun, verb, adjective, adverb, other
- conceptlist (required): name of the conceptlist the concept should be added to
- description (required): description of the concept
- type (required): type id of the type of the new concept
- synonymids: ids of synonyms for the new concept
- equals: URIs of concepts that are equal to the new concept
- similar: URIs of concepts that are similar to the new concepts
Add several concepts
You can add serveral concepts by making a POST request to the following URL:
http://[server.url]/conceptpower/rest/concepts/add
You define the values of the concepts you want to add as a JSON array:
[
{
"word":"kitty",
"pos": "noun",
"conceptlist":"mylist",
"description":"Soft kitty, sleepy kitty, little ball of fur.",
"type":"LivingBeing"
},
{
"word":"Tomcat",
"pos": "noun",
"conceptlist":"mylist",
"description":"Tomcat, the server.",
"type":"ComputerScience"
}
]
The attributes that can be submitted for every concepts are the same as the ones described above.
Conceptpower will return a JSON array with entries for each concepts that indicate if submission was successful.
Creating WordNet Wrappers
You can create a wrapper for an existing WordNet concept, but adding a wordnetIds
entry to the JSON you submit. If there does not exist a wrapper for the provided WordNet concept, a new wrapper will be created.
{
"wordnetIds": "WID-00450866-N-01-pony-trekking,WID-03981924-N-01-pony_cart",
"word":"kitty",
"pos": "noun",
"conceptlist":"mylist",
"description":"Soft kitty, sleepy kitty, little ball of fur.",
"type":"LivingBeing"
}
Note that if you submit a wordNet id, the fields pos
and word
will be ignored.