<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://wiki.serverdev-mediawiki-v1/" />
<title>lua_function</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">lua_function</td></tr>
</thead><tbody>
<tr>
	<td>store</td>
	<td>javascript{&quot;TestPage&quot;+Math.random()}</td>
	<td>Title</td>
</tr>
<tr>
	<td>open</td>
	<td>/index.php?title=Module:LinkedWikiTest${Title}&amp;action=edit</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=wpTextbox1</td>
	<td><br />local p = {}<br /><br />function p.checkLitteral(query, litteral)<br />&nbsp;&nbsp;&nbsp;&nbsp;local result = ''<br />&nbsp;&nbsp;&nbsp;&nbsp;if string.match(query, litteral) then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = &quot;OK&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = &quot;KO&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;end<br />&nbsp;&nbsp;&nbsp;&nbsp;return result<br />end<br /><br /><br />function p.checkString(val1, val2)<br />&nbsp;&nbsp;&nbsp;&nbsp;local result = ''<br />&nbsp;&nbsp;&nbsp;&nbsp;if (val1 ==&nbsp;&nbsp;nil or val2 ==&nbsp;&nbsp;nil) then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = &quot;KO1&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if val1 ==&nbsp;&nbsp;val2 then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = &quot;OK&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = &quot;KO2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />&nbsp;&nbsp;&nbsp;&nbsp;end<br />&nbsp;&nbsp;&nbsp;&nbsp;return result<br />end<br />function p.checkNumber(val1, val2)<br />&nbsp;&nbsp;&nbsp;&nbsp;local result = ''<br />&nbsp;&nbsp;&nbsp;&nbsp;if (val1 ==&nbsp;&nbsp;nil or val2 ==&nbsp;&nbsp;nil) then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = &quot;KO&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if tonumber(val1) ==&nbsp;&nbsp;tonumber(val2) then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = &quot;OK&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result = &quot;KO&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />&nbsp;&nbsp;&nbsp;&nbsp;end<br />&nbsp;&nbsp;&nbsp;&nbsp;return result<br />end<br /><br /><br />function p.tests(f)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local linkedwiki = require 'linkedwiki'<br />&nbsp;&nbsp;&nbsp;&nbsp;local endpoint = 'http://database-test:8890/sparql'<br />&nbsp;&nbsp;&nbsp;&nbsp;local config = 'http://database-test'<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local xsd = 'http://www.w3.org/2001/XMLSchema#'<br />&nbsp;&nbsp;&nbsp;&nbsp;local rdfs = 'http://www.w3.org/2000/01/rdf-schema#'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local pr = 'http://database-test/TestFunction:'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local html = '== TESTS =='.. '\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;linkedwiki.setDebug(true)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : linkedwiki.getCurrentIRI()&quot; .. '\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. linkedwiki.getCurrentIRI() .. '\n'<br /><br />local subject = linkedwiki.getCurrentIRI()<br /><br /><br />local objTest = linkedwiki.new(subject,config)<br />&nbsp;&nbsp;&nbsp;&nbsp;local pTObjTemp1 = mw.title.new(&quot;Title1&quot;):fullUrl()<br />&nbsp;&nbsp;&nbsp;&nbsp;local pTObjTemp2 = mw.title.new(&quot;Title2&quot;):fullUrl()<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local ObjTemp1 = linkedwiki.new(pTObjTemp1);<br />&nbsp;&nbsp;&nbsp;&nbsp;local ObjTemp2 = linkedwiki.new(pTObjTemp2);<br /><br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:removeSubject())<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : checkValue&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;function linkedwiki.checkValue(property, valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;local valueInWiki = 0<br />&nbsp;&nbsp;&nbsp;&nbsp;local result = &quot;&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;local pT =&quot;&quot;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;pT = pr..'1'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;1&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkValue(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value&quot;&gt;1&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithLitteral(pT,1))<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;1&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkValue(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;1&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result =objTest:checkValue(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : 1&quot;&gt;2&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : checkString&quot; ..'\n'<br />--&nbsp;&nbsp;&nbsp;&nbsp;function objTest:checkString(property, valueInWiki, tagLang)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;pT = pr..'2'<br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;test&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkString(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value&quot;&gt;test&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;--mw.log(objTest:addPropertyWithLitteral(pT,&quot;test&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyString(pT,&quot;test&quot;))<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;test&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkString(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;test&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;testDifferent&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkString(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : test&quot;&gt;testDifferent&lt;/div&gt;') ..'\n'<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;--mw.log(objTest:addPropertyWithLitteral(pT,&quot;testfr&quot;,nil,&quot;fr&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyString(pT,&quot;testfr&quot;,&quot;fr&quot;))<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;testfr&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkString(pT,valueInWiki,&quot;fr&quot;)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; .. '\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;testfr&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;testfrDifferent&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkString(pT,valueInWiki,&quot;fr&quot;)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : testfr&quot;&gt;testfrDifferent&lt;/div&gt;') ..'\n'<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : checkLabelOfInternLink&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;function objTest:checkLabelOfInternLink(link, propertyOfLabel, labelInWiki, tagLang)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;pT = pr..'3'<br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;test&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;local link = &quot;http://example.com/link&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkLabelOfInternLink(link,pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://example.com/link test]&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithLitteral(pT,&quot;test&quot;))<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;test&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkLabelOfInternLink(link,pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://example.com/link test]&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;test2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkLabelOfInternLink(link,pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : test&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://example.com/link test2]&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : checkIriOfExternLink&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;-- function objTest:checkIriOfExternLink(labelOfExternLink, propertyOfExternLink, externLinkInWiki)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;pT = pr..'4'<br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;http://example.com/test&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkIriOfExternLink(&quot;test&quot;,pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value&quot;&gt;[http://example.com/test test]&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithIri(pT,&quot;http://example.com/test&quot;))<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;http://example.com/test&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkIriOfExternLink(&quot;test&quot;,pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;[http://example.com/test test]&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;http://example.com/test2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkIriOfExternLink(&quot;test&quot;,pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : http://example.com/test&quot;&gt;[http://example.com/test2 test]&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : checkImage&quot; ..'\n'<br />--&nbsp;&nbsp;&nbsp;&nbsp;function objTest:checkImage(property, valueInWiki, width, height)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;pT = pr..'5'<br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;http://example.com/test.png&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkImage(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value&quot;&gt;&lt;img src=&quot;http://example.com/test.png&quot; /&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithIri(pT,&quot;http://example.com/test.png&quot;))<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;http://example.com/test.png&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkImage(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;img src=&quot;http://example.com/test.png&quot; /&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;http://example.com/test2.png&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkImage(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : http://example.com/test.png&quot;&gt;&lt;img src=&quot;http://example.com/test2.png&quot; /&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : checkTitle&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;-- objTest:checkTitle(property, labelInWiki, tagLang)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;objTest:setDebug(true)<br />&nbsp;&nbsp;&nbsp;&nbsp;pT = pr..'6'<br />&nbsp;&nbsp;&nbsp;&nbsp;local pTObjTemp1 = mw.title.new(&quot;Title1&quot;):fullUrl()<br />&nbsp;&nbsp;&nbsp;&nbsp;local pTObjTemp2 = mw.title.new(&quot;Title2&quot;):fullUrl()<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local ObjTemp1 = linkedwiki.new(pTObjTemp1,config);<br />&nbsp;&nbsp;&nbsp;&nbsp;local ObjTemp2 = linkedwiki.new(pTObjTemp2,config);<br /><br />--&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:getConfig())<br />--&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp1:getConfig())<br />--&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:getConfig())<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:removeSubject())<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp1:removeSubject())<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:removeSubject())<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--0 in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkTitle(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;Title1;Title2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--0 in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkTitle(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value&quot;&gt;[[Title1]], [[Title2]]&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot; Title1;Title2 &quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;-- current - pT -&gt; pTObj<br />&nbsp;&nbsp;&nbsp;&nbsp;-- pTObj - rdfs:label -&gt; &quot;Title1&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithIri(pT, pTObjTemp1))<br />&nbsp;&nbsp;&nbsp;&nbsp;--mw.log(ObjTemp1:addPropertyWithLitteral(rdfs..&quot;label&quot;,&quot;Title1&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp1:addPropertyString(rdfs..&quot;label&quot;,&quot;Title1&quot;))<br />&nbsp;&nbsp;&nbsp;-- mw.log(linkedwiki.getLastQuery())<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkTitle(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : Title1&quot;&gt;[[Title2]]&lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/Title1 Title1]&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;Title1 ; Title2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1;Title2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;-- current - pT -&gt; pTObj2<br />&nbsp;&nbsp;&nbsp;&nbsp;-- pTObj2 - rdfs:label -&gt; &quot;Title2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithIri(pT,pTObjTemp2))<br />&nbsp;&nbsp;&nbsp;&nbsp;--mw.log(objTest:addPropertyWithLitteral(rdfs..&quot;label&quot;,&quot;Title2&quot;,nil,nil,pTObj2))<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:addPropertyString(rdfs..&quot;label&quot;,&quot;Title2&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkTitle(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/Title1 Title1]&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/Title2 Title2]&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1;Title2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkTitle(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/Title1 Title1]&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/Title2 Title2]&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : checkUser&quot; ..'\n'<br />--&nbsp;&nbsp;&nbsp;&nbsp;function objTest:checkUser(property, valueInWiki)<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:removeSubject())<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;pT = pr..'7'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local pTObjTemp1 = mw.title.new(&quot;User:Firstname Surename1&quot;):fullUrl()<br />&nbsp;&nbsp;&nbsp;&nbsp;local pTObjTemp2 = mw.title.new(&quot;User:Firstname Surename2&quot;):fullUrl()<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local ObjTemp1 = linkedwiki.new(pTObjTemp1,config)<br />&nbsp;&nbsp;&nbsp;&nbsp;local ObjTemp2 = linkedwiki.new(pTObjTemp2,config)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:removeSubject())<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp1:removeSubject())<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:removeSubject())<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--0 in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkUser(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;User1;User2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--0 in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkUser(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value&quot;&gt;[[User:User1|User1]], [[User:User2|User2]]&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki&nbsp;&nbsp;= &quot;Firstname Surename1; Firstname Surename2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;User:Firstname Surename1&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;-- current - pT -&gt; pTObj<br />&nbsp;&nbsp;&nbsp;&nbsp;-- pTObj - rdfs:label -&gt; &quot;User:Firstname Surename1&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithIri(pT, pTObjTemp1))<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp1:addPropertyWithLitteral(rdfs..&quot;label&quot;,&quot;Firstname Surename1&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkUser(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : Firstname Surename1&quot;&gt;[[User:Firstname Surename2|Firstname Surename2]]&lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename1 Firstname Surename1]&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki&nbsp;&nbsp;= &quot;Firstname Surename1; Firstname Surename2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;User:Firstname Surename1;User:Firstname Surename2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;User:Firstname Surename2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;-- current - pT -&gt; pTObj2<br />&nbsp;&nbsp;&nbsp;&nbsp;-- pTObj2 - rdfs:label -&gt; &quot;User:Firstname Surename2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithIri(pT,pTObjTemp2))<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:addPropertyWithLitteral(rdfs..&quot;label&quot;,&quot;Firstname Surename2&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkUser(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename1 Firstname Surename1]&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename2 Firstname Surename2]&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki&nbsp;&nbsp;= &quot;Firstname Surename1; Firstname Surename2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;User:Firstname Surename1;User:Firstname Surename2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;mailto:Firstname_Surename2@example.com&quot; ADD in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;-- current - pT -&gt; pTObj2<br />&nbsp;&nbsp;&nbsp;&nbsp;-- pTObj2 - http://www.w3.org/2006/vcard/ns#email -&gt; &quot;mailto:Firstname_Surename2@example.com&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:addPropertyWithIri(&quot;http://www.w3.org/2006/vcard/ns#email&quot;,&quot;mailto:Firstname_Surename2@example.com&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkUser(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename1 Firstname Surename1]&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename2 Firstname Surename2]&lt;/span&gt;&lt;sub&gt;&lt;span class=&quot;plainlinks&quot; style=&quot;font-size: large;&quot;&gt;[mailto:Firstname_Surename2@example.com &amp;#9993;]&lt;/span&gt;&lt;/sub&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..ObjTemp2:getValue(&quot;http://www.w3.org/2006/vcard/ns#email&quot;) ..'\n'..&quot;END&quot; ..'\n'<br /><br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki&nbsp;&nbsp;= &quot;Firstname Surename1; Firstname Surename2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;User:Firstname Surename1;User:Firstname Surename2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;mailto:Firstname_Surename2@example.com&quot; ADD in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;-- current - pT -&gt; pTObj2<br />&nbsp;&nbsp;&nbsp;&nbsp;-- pTObj2 - http://www.w3.org/2006/vcard/ns#email -&gt; &quot;mailto:Firstname_Surename2@example.com&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:addPropertyWithIri(&quot;http://www.w3.org/2006/vcard/ns#email&quot;,&quot;mailto:Firstname_Surename2Bis@example.com&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkUser(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename1 Firstname Surename1]&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename2 Firstname Surename2]&lt;/span&gt;&lt;sub&gt;&lt;span class=&quot;plainlinks&quot; style=&quot;font-size: large;&quot;&gt;[mailto:Firstname_Surename2@example.com &amp;#9993;]&lt;/span&gt;&lt;/sub&gt;&lt;sub&gt;&lt;span class=&quot;plainlinks&quot; style=&quot;font-size: large;&quot;&gt;[mailto:Firstname_Surename2Bis@example.com &amp;#9993;]&lt;/span&gt;&lt;/sub&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1;Title2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkUser(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename1 Firstname Surename1]&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[http://wiki.serverdev-mediawiki-v1/index.php/User:Firstname_Surename2 Firstname Surename2]&lt;/span&gt;&lt;sub&gt;&lt;span class=&quot;plainlinks&quot; style=&quot;font-size: large;&quot;&gt;[mailto:Firstname_Surename2@example.com &amp;#9993;]&lt;/span&gt;&lt;/sub&gt;&lt;sub&gt;&lt;span class=&quot;plainlinks&quot; style=&quot;font-size: large;&quot;&gt;[mailto:Firstname_Surename2Bis@example.com &amp;#9993;]&lt;/span&gt;&lt;/sub&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : checkItem&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;function objTest:checkItem(property, valueInWiki, tagLang)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:removeSubject())<br />&nbsp;&nbsp;&nbsp;objTest:setDebug(true)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;pT = pr..'8'<br />&nbsp;&nbsp;&nbsp;&nbsp;local wd = &quot;http://www.wikidata.org/entity/&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;local pTObjTemp1 = wd..&quot;Q1&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;local pTObjTemp2 = wd..&quot;Q2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;local ObjTemp1 = linkedwiki.new(pTObjTemp1,config)<br />&nbsp;&nbsp;&nbsp;&nbsp;local ObjTemp2 = linkedwiki.new(pTObjTemp2,config)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:removeSubject())<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp1:removeSubject())<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:removeSubject())<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--0 in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkItem(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;Q1 ; Q2 &quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--0 in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkItem(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[[https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q2 Earth]&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;&lt;small&gt;([http://www.wikidata.org/entity/Q2 Q2])&lt;/small&gt;&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[[https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q1 universe]&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;&lt;small&gt;([http://www.wikidata.org/entity/Q1 Q1])&lt;/small&gt;&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki =&nbsp;&nbsp;&quot;Q1;Q2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;-- current - pT -&gt; pTObj<br />&nbsp;&nbsp;&nbsp;&nbsp;-- pTObj - rdfs:label -&gt; &quot;universe&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithIri(pT, pTObjTemp1))<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp1:addPropertyWithLitteral(rdfs..&quot;label&quot;,&quot;universe&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkItem(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : universe&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[[https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q2 Earth]&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;&lt;small&gt;([http://www.wikidata.org/entity/Q2 Q2])&lt;/small&gt;&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;[[https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q1 universe]&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;&lt;small&gt;([http://www.wikidata.org/entity/Q1 Q1])&lt;/small&gt;&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot; Q1 ; Q2 &quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1;Title2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;-- current - pT -&gt; pTObj2<br />&nbsp;&nbsp;&nbsp;&nbsp;-- pTObj2 - rdfs:label -&gt; &quot;Title2&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:addPropertyWithIri(pT,pTObjTemp2))<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(ObjTemp2:addPropertyWithLitteral(rdfs..&quot;label&quot;,&quot;Earth&quot;))<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkItem(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[[https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q2 Earth]&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;&lt;small&gt;([http://www.wikidata.org/entity/Q2 Q2])&lt;/small&gt;&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[[https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q1 universe]&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;&lt;small&gt;([http://www.wikidata.org/entity/Q1 Q1])&lt;/small&gt;&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;valueInWiki = &quot;&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;Title1;Title2&quot; in DB<br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:checkItem(pT,valueInWiki)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;&lt;span class=&quot;plainlinks&quot;&gt;[[https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q2 Earth]&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;&lt;small&gt;([http://www.wikidata.org/entity/Q2 Q2])&lt;/small&gt;&lt;/span&gt;, &lt;span class=&quot;plainlinks&quot;&gt;[[https://www.wikidata.org/wiki/Special:GoToLinkedPage/enwiki/Q1 universe]&lt;/span&gt;&lt;span class=&quot;plainlinks&quot;&gt;&lt;small&gt;([http://www.wikidata.org/entity/Q1 Q1])&lt;/small&gt;&lt;/span&gt;&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;----------------------------------------------------------------------------&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;TEST : printDateInWiki&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;--Linkedwiki:printDateInWiki(format, valueInWiki, valueInDB)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;local dateFormat = &quot;d M Y&quot;<br />&nbsp;&nbsp;&nbsp;&nbsp;--&nbsp;&nbsp;{{#time:d M Y|2004-12-06}}<br />&nbsp;&nbsp;&nbsp;&nbsp;--&quot;2004-12-06&quot;^^xsd..'date'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:printDateInWiki(dateFormat, &quot;2004-12-06&quot;, &quot;2004-12-06&quot;)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_value_equal&quot;&gt;{{#time:d M Y|2004-12-06}}&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;result = objTest:printDateInWiki(dateFormat, &quot;2004-12-07&quot;, &quot;2004-12-06&quot;)<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT BEGIN : &quot;..'\n' ..result ..'\n'..&quot;END&quot; ..'\n'<br />&nbsp;&nbsp;&nbsp;&nbsp;html = html ..&quot;RESULT : &quot; .. p.checkString(result,'&lt;div class=&quot;linkedwiki_new_value linkedwiki_tooltip&quot; data-toggle=&quot;tooltip&quot; data-placement=&quot;bottom&quot; title=&quot;Currently in DB : 2004-12-06&quot;&gt;{{#time:d M Y|2004-12-07}}&lt;/div&gt;') ..'\n'<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;objTest:addProperty('http://example.com/deces',&quot;2004-12-06&quot;,xsd..'date')<br /><br />--&nbsp;&nbsp;&nbsp;&nbsp;mw.log(linkedwiki.getLastQuery())<br />&nbsp;&nbsp;&nbsp;&nbsp;mw.log(objTest:removeSubject())<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;--return html<br />&nbsp;&nbsp;&nbsp;&nbsp;return &quot;&lt;nowiki&gt;&lt;pre&gt;&quot;..mw.text.encode( html)..&quot;&lt;/pre&gt;&lt;/nowiki&gt;&quot;<br />end<br /><br />return p<br /></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=wpSave</td>
	<td></td>
</tr>
<tr>
	<td>open</td>
	<td>/index.php/LinkedWikiTestLua${Title}?action=edit</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=wpTextbox1</td>
	<td>{{#invoke: LinkedWikiTest${Title} | tests}}</td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=wpSave</td>
	<td></td>
</tr>
<tr>
	<td>open</td>
	<td>/index.php/LinkedWikiTestLua${Title}?action=purge</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>css=input.mw-htmlform-submit</td>
	<td></td>
</tr>
<tr>
	<td>verifyText</td>
	<td>//div[@id='mw-content-text']/pre</td>
	<td>*TEST :*</td>
</tr>
<tr>
	<td>verifyNotText</td>
	<td>//div[@id='mw-content-text']/pre</td>
	<td>*KO*</td>
</tr>
</tbody></table>
</body>
</html>
