create meme

2 views
Skip to first unread message

Shamsh

unread,
Apr 10, 2008, 10:02:33 AM4/10/08
to ASAPI Developers
if i want to save a web page then what will have to do?
Which format should i use?

=> Meme external resource
or
=> Meme document

And plz describe all the tags(xml) which i have to send to create a
meme.
When should i set the directory for the meme ( After creating a meme
or same time of creation)?

And if possible give a clear idea about meme.

Shamsh

Marc Hadfield

unread,
Apr 10, 2008, 10:22:23 AM4/10/08
to asap...@googlegroups.com

Hi Shamsh --

You should use the MemeDocument object.

The documentation should describe the XML tags. The content of the
webpage can be stored in the "content" field of the MemeDocument.

After you create the MemeDocument, you should annotate it with a
LinkToURL using the URL of the webpage.

After you create the MemeDocument, and you can then add it to the
desired directory (topic).

For our system, a "Meme" is just a data record.

-- Marc Hadfield


--
-------
Marc Hadfield
Alitora Systems
(917)991-9685
ma...@alitora.com
http://www.alitora.com

Shamsh

unread,
Apr 11, 2008, 12:50:38 AM4/11/08
to ASAPI Developers
As your response I should use following format, am i right?

<memeDocument>
<name>{ }</name>
<scope>{ }</scope>
<source>{ }</source>
<text>{ }</text>
<description>{ }</description>*
<categoryID>{ }</categoryID>*
</memeDocument>

What does it mean?
'source' - source of the document (Is it the html of the web page?)
'text' - text of the document (brief) (What is text ? Note or anything
else?)

Shamsh
> m...@alitora.comhttp://www.alitora.com

Shamsh

unread,
Apr 11, 2008, 2:10:11 AM4/11/08
to ASAPI Developers
Plz Give me 2 example of
after creating meme place it into memory &
after creating meme place it into team

On Apr 10, 8:22 pm, Marc Hadfield <m...@alitora.com> wrote:
> m...@alitora.comhttp://www.alitora.com

siaroslaw

unread,
Apr 11, 2008, 3:50:31 AM4/11/08
to ASAPI Developers
Hi,
actually the "text" field should contain the content of the document,
either plain text or html.
As of now, the "source" field may be left empty.

Derek

Shamsh

unread,
Apr 11, 2008, 4:41:42 AM4/11/08
to ASAPI Developers
Thanks.Its clear now.

after creating the meme i get return a xml.That indicates that the
creation is successful.
Then I have to annotate it with a url the format is like following but
where i have to send it?
<annotation-linkToURL>
<description>{ }</description>
<scope>{ }</scope>
<url>{myUrl}</url>
</annotation-linkToURL>

1) http://web.alitora.com/ASAPI_REST/asapi/0001/xml//annotation/<umis>
or
2) http://web.alitora.com/ASAPI_REST/asapi/0001/xml//annotation/<umis>/annotate

then what is umis?

siaroslaw

unread,
Apr 11, 2008, 5:19:35 AM4/11/08
to ASAPI Developers
Hi,

the answer is: neither of above. You have to annotate the meme
document you created. That's why you should use:
http://web.alitora.com/ASAPI_REST/asapi/0001/xml/meme/<umis>/annotate
as you are annotating the meme, not the annotation.
The <umis> is the the umis of the meme document you created. You can
get it from the response.
You couldn't use the url to the annotation, because you do not know
the umis of the annotation you are going to create.

Derek

On Apr 11, 10:41 am, Shamsh <shamsh.tab...@gmail.com> wrote:
> Thanks.Its clear now.
>
> after creating the meme i get return a xml.That indicates that the
> creation is successful.
> Then I have to annotate it with a url the format is like following but
> where i have to send it?
> <annotation-linkToURL>
> <description>{ }</description>
> <scope>{ }</scope>
> <url>{myUrl}</url>
> </annotation-linkToURL>
>
> 1)http://web.alitora.com/ASAPI_REST/asapi/0001/xml//annotation/<umis>
> or
> 2)http://web.alitora.com/ASAPI_REST/asapi/0001/xml//annotation/<umis>/annotate
>
> then what is umis?
>

siaroslaw

unread,
Apr 11, 2008, 5:23:03 AM4/11/08
to ASAPI Developers
Hi,

I updated the example PHP script.
here is the snippet I inserted that should give you the idea (the team
acts similarily to memory).

Derek

--------


//CREATE NEW MEME (JSON format)
$memeForm = "{\"meme\":{\"name\":\"JSON example 5\",\"description\":
\"sample meme as JSON\",\"longDescription\":\"this is a very simple
meme created with JSON\",\"categoryID\":\"test\",\"scope\":\"public
\"}}";
$createMemeURL = $url_base . 'meme/create'.'?sessionID='.$sessionID;

print "Create meme URL: " . $createMemeURL;

$session = curl_init($createMemeURL);

// Set the POST options.
curl_setopt ($session, CURLOPT_POST, true);
curl_setopt ($session, CURLOPT_POSTFIELDS, $memeForm);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

$response = execute($session);
curl_close($session);
$responseBody = $response['body'];
print "Response code: " . $response['http_code'] ."\n";
print $responseBody ."\n";

// ADD the newly created into memory
$jsonResponse = json_decode($responseBody,true);
$createdMemeUMIS = $jsonResponse['status']['responseObject']['umis'];

$addToMemoryURL = $url_base . 'memory/'. $createdMemeUMIS . '?
sessionID='.$sessionID;
print "adding to memory : " . $addToMemoryURL;
// Get the curl session object
$session = curl_init($addToMemoryURL);

curl_setopt ($session, CURLOPT_PUT, true);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt ($session, CURLOPT_POSTFIELDS, $createdMemeUMIS);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

// USE CUSTOM EXEC
$response = execute($session);
curl_close($session);
$responseBody = $response['body'];
print "Response code: " . $response['http_code'] ."\n";
print $responseBody ."\n";

//SHOW MEMORY
$memoryURL = $url_base . "memory?sessionID=".$sessionID;
print "MEMORY request: " . $memoryURL;
// Get the curl session object
$session = curl_init($memoryURL);
curl_setopt ($session, CURLOPT_HTTPGET, true);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// USE CUSTOM EXEC
$response = execute($session);
curl_close($session);
$responseBody = $response['body'];
print "Response code: " . $response['http_code'] ."\n";
print $responseBody ."\n";

Shamsh

unread,
Apr 11, 2008, 6:17:50 AM4/11/08
to ASAPI Developers
Thanks Derek.
Now I can create memeDocument and can save it into the memory or team.
But the problem is
when i add newly created meme to the memory or team it return '1'.
How could i know where(in which directory or topic) it saved in the
memory.
Also how could i save the newly created meme in memory or team into
my suggested directory or topic
Your given example says that
after adding the meme into memory
//show memory
It returns the same which i have before adding the meme.

siaroslaw

unread,
Apr 11, 2008, 6:36:19 AM4/11/08
to ASAPI Developers
Hi,

Every operation that modifies the memory returns the number of memes
in memory - it might be helpful.
To see where the meme is located you have to analyze the '/memory'
results. Are you sure the meme is added corectly?
What is the response of the PUT operation? There is status code in the
response which might be helpful:
<code>
<name>OK</name>
</code>

To add meme into topic you have do PUT it using .../memory/
<topic_umis>/<meme_umis> url, as described in documentation.

Derek

Shamsh

unread,
Apr 17, 2008, 2:36:52 AM4/17/08
to ASAPI Developers
Hi,

When I create a meme i get xml format which is converted into an array
is following-----

Array
(
[code] => Array
(
[name] => OK
)

[responseObject] => Array
(
[umis] => Com.Memomics.AlitoraSystems.memomics.1155817
[name] => test Create Meme
[creatorUMIS] => Com.Memomics.AlitoraSystems.memomics.
1155294
[categoryID] => testnode
[creationDate] => Array
(
[milis] => 1208413067534
)

[numInteractionEdges] => 0
[numSubsumptionEdges] => 0
[ontologyVersion] => 1.0
[ontologyID] => test ontology id 1
[ontologyURL] => http://meme.net.ai
[scope] => public
[segment] => memomics
[version] => 1.0
[text] => test text
)

)

then as derek said before it should add to the memory.

then i am trying to add newly created meme to the memory under a topic
I send the request to
http://web.alitora.com/ASAPI_REST/asapi/0001/xml/memory/Com.Memomics.AlitoraSystems.memomics.1155756/Com.Memomics.AlitoraSystems.memomics.1155818?sessionID=M_B.12084059802260.7995660212055935
where
Com.Memomics.AlitoraSystems.memomics.1155756 = topic_umis
Com.Memomics.AlitoraSystems.memomics.1155818 = newly created meme umis

after sending it to i get return only '1'
What is it ?
What does '1' means?
Coz I was asking in one previous post that am i sure that memory was
added successfully? and
is the response is like that?

<code>
<name>OK</name>
</code>
My ans is no . i get just only a numeric 1

siaroslaw

unread,
Apr 17, 2008, 5:19:53 AM4/17/08
to ASAPI Developers
Hi,

I numeric value returned in case of successful placing a meme or topic
into memory is the total number of memes and topic in memory.
I can see you successfully create topics, but there are no memes in
memory. Since the apache blocks PUT requests with empty entites, you
have to repeat the umis of the meme being added in request entity.
This problem has been discovered recently and included in ASAPI
RESTful Interface documentation either.

Thanks,
Derek
> I send the request tohttp://web.alitora.com/ASAPI_REST/asapi/0001/xml/memory/Com.Memomics....
Reply all
Reply to author
Forward
0 new messages