SDService

This service takes sets of words stored into multiple profiles of a Personal Service (PS) record and looks for similar documents (via ngrams) in a database, for example, LILACS+MEDLINE.

Services:

Add profile

Add PS service profile words

Syntax: SDService?psId=<psId>&addProfile=<id>&sentence=<sentence>

psId: personal service record identifier
id: profile name
sentence: a sentence with the words stored in the profile

Example: SDService?psId=Joao Doria&addProfile=books&sentence=my preferences are: romance, adventure, scifi

Possible return values:
  <result>OK</result>
  <ERRROR>missing 'psId' parameter</ERROR>
  <ERRROR>missing 'addProfile' parameter</ERROR>
  <ERRROR>missing 'sentence' parameter</ERROR>

Delete profile

Delete in this service a PS record profile

Syntax: SDService?psId=<id>&deleteProfile=<id>

psId: personal service record identifier
id: profile identifier

Example: SDService?psId=Joao Doria&deleteProfile=books

Possible return values:
  <result>OK</result>
  <result>FAILED</result>
  <ERRROR>missing 'psId' parameter</ERROR>
  <ERRROR>missing 'deleteProfile' parameter</ERROR>

Get similar documents

Retrieve documents having most of words stored in a set of profiles

Syntax: SDService?psId=<id>&getSimDocs=<profile>,..,<profile>[&outFields=<field>,...,<field>][&considerDate=]

psId: personal service record identifier
getSimDocs: set of profile identifiers
outFields: tags of similar doc field to be outputed. If no fields were specified all fields will be outputed. Optional parameter.
considerDate: if present, will only return documents that are younger than default number of days. Optional parameter.

Example: SDService?psId=Joao Doria&getSimDocs=books,cars,hobbies&outFields=id,date,name&considerDate=

Possible return values:
  <documents>...</documents>
  <ERRROR>missing 'psId' parameter</ERROR>
  <ERRROR>missing 'getSimDocs' parameter</ERROR>

Adhoc similar documents

Retrieve documents having most of words present in an input string

Syntax: SDService?adhocSimilarDocs=<text>[&outFields=<field>,...,<field>][&maxDocs=<num>][&sources=<src>,...,<src>][&instances=<inst>,...,<inst>][&lastDays=<number_of_days>][&explain=<bool>][&ignoreUpdateDate=<bool>]

adhocSimilarDocs: words to be used to look for similar documents
outFields: tags of similar doc field to be outputed. If no fields were specified all fields will be outputed. Optional parameter.
maxDocs: if present, indicate the maximum number of outputed similar documents. Optional parameter.
sources: if present, return only documents whose 'db' field are equal to some source specified in this parameter. If no source was specified, the retrieved documents will not be filtered by 'db' field. Optional parameter.
instances: if present, return only documents whose 'instance' field are equal to some instance specified in this parameter. If no instance was specified, the retrieved documents will not be filtered by 'instance' field. Optional parameter.
lastDays: if present, show only documents that are younger than 'number_of_days' days. Optional parameter.
explain: if present or if true, show the origin document ngrams, the similar document ngrams and the common ngrams. Optional parameter.
ignoreUpdateDate if present of if true, show the most similar documents do not considering the entry date of them

Example: SDService?adhocSimilarDocs=books,cars,hobbies&sources=LILACS,LIS&lastDays=7

Possible return values:
  <documents>...</documents>
  <ERRROR>missing 'adhocSimDocs' parameter</ERROR>

Show users

Show all users from the PS

Syntax: SDService?showUsers=

Example: SDService?showUsers=

Possible return value:
  <users>...</users>

Show profiles

Show all profiles and respective words of a PS record

Syntax: SDService?psId=<psId>&showProfiles=

psId: personal service record identifier

Example: SDService?psId=Joao Doria&showProfiles=

Possible return values:
  <profiles>...</profiles>
  <ERRROR>missing 'psId' parameter</ERROR>