Getting error while querying custom created "Knowledge exploration service" - machine-learning

I have created a custom demo based on documentation. When I host my files locally it is giving the following error "CancellationToken. Timeout!" and I'm not getting any search suggestions from web service. What could be the issue?
I tried my best to mimic the grammar file given in sample example
Search.schema
{
"attributes":[
{"name":"ClassCD","type":"string"},
{"name":"Year","type":"string"},
{"name":"Keyword", "type":"String", "synonyms":"Keyword.syn"}
]
}
Keyword.syn
["class","grade"]
["year","academicyear"]
["year","schoolyear"]
Search.Data
{"ClassCD":"class 1","Year":2018}
{"ClassCD":"class 2","Year":2018}
{"ClassCD":"class 3","Year":2018}
{"ClassCD":"class 4","Year":2018}
{"ClassCD":"class 5","Year":2018}
{"ClassCD":"class 6","Year":2018}
{"ClassCD":"class 7","Year":2018}
{"ClassCD":"class 8","Year":2018}
{"ClassCD":"class 9","Year":2018}
{"ClassCD":"class 10","Year":2018}
Grammar File
<grammar root="GetStudents">
<import schema="search.schema" name="search" />
<!-- Get Students by Class-->
<rule id="GetStudents">
<example>students from class 1</example>
students
<tag>
yearOnce = false;
isBeyondEndOfQuery = false;
searchQuery = All();
</tag>
<item repeat="1-">
<tag>AssertEquals(isBeyondEndOfQuery, false);</tag>
<one-of>
<item>
from <attrref uri="search#ClassCD" name="className"/>
<tag>searchQuery=className;</tag>
</item>
<tag> searchQuery=searchQuery;</tag>
</one-of>
</item>
<tag> out=searchQuery; </tag>
</rule>
</grammar>

Related

Parsing data for tag which has colon using RaptureXML in iOS

I have the xml structure xml like that:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">
<channel>
<item>
<comments>http://www.rtl.fr/actu/politique/laurent-gerra-imitant-nicolas-sarkozy-il-faut-barrer-la-
<slash:comments>0</slash:comments>
</item>
</channel>
</rss>
How can I get text in <slash:comments> tag.
I already try(Swift version):
elementItem.child("comments",inNamespace: "slash").
But it don't work.
As stated here, RaptureXML deletes namespaces, so you can access your content via
elementItem.child("comments")

Jira gadget is not working

I am trying to develop a gadget that will ultimately incorporate ChartJS, but I am having issues with the default gadget, as it does not load.
The code I am putting into the attlassian-plugin.xml is the following:
<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}" />
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="report"/>
<!-- add our web resources -->
<web-resource key="report-resources" name="report Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="report.css" location="/css/report.css"/>
<resource type="download" name="report.js" location="/js/report.js"/>
<resource type="download" name="images/" location="/images"/>
<context>report</context>
</web-resource>
<!-- publish our component -->
<component key="myPluginComponent" class="com.wfs.report.MyPluginComponentImpl" public="true">
<interface>com.wfs.report.MyPluginComponent</interface>
</component>
<!-- import from the product container -->
<component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" />
<webwork1 key="demoaction" name="JTricks Demo Action" class="java.lang.Object">
<actions>
<action name="com.wfs.report.DemoAction" alias="DemoAction">
<view name="input">/templates/input.vm</view>
<view name="success">/templates/joy.vm</view>
<view name="error">/templates/tears.vm</view>
</action>
</actions>
</webwork1>
<atlassian-plugin name="Hello World" key="example.plugin.helloworld" plugins-version="2">
<plugin-info>
<description>A basic gadget module</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<gadget key="unique-gadget-key" location="gadget.xml"/>
</atlassian-plugin>
</atlassian-plugin>
and my gadget.xml which i put in the resources directory is:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="JIRA Issues" author_email="adent#example.com" directory_title="JIRA Issues"
screenshot="images/screenshot.png"
thumbnail="images/thumbnail.png">
<Optional feature="dynamic-height" />
</ModulePrefs>
<Content type="html">
<![CDATA[
Hello, world!
]]>
</Content>
</Module>
</xml>
which I copied from https://developer.atlassian.com/display/GADGETS/Creating+your+Gadget+XML+Specification
yet I still get
It looks like you have one plugin descriptor nested inside another plugin descriptor. (I'm surprised that it actually passed validation!)
Change this:
<atlassian-plugin name="Hello World" key="example.plugin.helloworld" plugins-version="2">
<plugin-info>
<description>A basic gadget module</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<gadget key="unique-gadget-key" location="gadget.xml"/>
</atlassian-plugin>
to just this:
<gadget key="unique-gadget-key" location="gadget.xml"/>

Cordys BPM - Create an E-mail Model based on an XML Schema Document

I have created a standalone email model and generated a web service based on the email model. I followed the same steps as described in the Cordys documentation ( https://wiki.cordys.com/display/bop41/Creating+an+E-mail+Model ) but when I try to invoke the web service I am getting a fault like "Do not understand method TAT_Email_Model_WebserviceOperation of type NSCUST".
I have linked my WebServiceInterface to an Email service container ( correct me if I am done wrong over here).
The complete description of the fault is as below. Any suggestions.
<ErrorDetails>
<Request>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<header xmlns="http://schemas.cordys.com/General/1.0/">
<Logger xmlns="http://schemas.cordys.com/General/1.0/" />
</header>
<i18n:international xmlns:i18n="http://www.w3.org/2005/09/ws-i18n">
<locale xmlns="http://www.w3.org/2005/09/ws-i18n">en-US</locale>
</i18n:international>
</SOAP:Header>
<SOAP:Body>
<TAT_Email_Model_WebserviceOperation xmlns="http://schemas.cordys.com/1.0/email">
<SOURCE>Notification Custom Method</SOURCE>
<MESSAGE_DATA>
<Application>
<data>
<message_data />
<message_metadata />
</data>
</Application>
</MESSAGE_DATA>
<SUBJECT>PARAMETER</SUBJECT>
<attachments>
<attachment name="" encoded="false">PARAMETER</attachment>
</attachments>
<SENDER_ADDRESS>
<MAIL_ID>PARAMETER</MAIL_ID>
<DISPLAY_NAME>PARAMETER</DISPLAY_NAME>
</SENDER_ADDRESS>
<RECEIVERS>
<MAILING_LIST>
<to>
<address>
<displayName>PARAMETER</displayName>
<emailAddress>PARAMETER</emailAddress>
</address>
</to>
<cc>
<address>
<displayName>PARAMETER</displayName>
<emailAddress>PARAMETER</emailAddress>
</address>
</cc>
<bcc>
<address>
<displayName>PARAMETER</displayName>
<emailAddress>PARAMETER</emailAddress>
</address>
</bcc>
</MAILING_LIST>
</RECEIVERS>
</TAT_Email_Model_WebserviceOperation>
</SOAP:Body>
</SOAP:Envelope>
</Request>
<Response>
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<header xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.cordys.com/General/1.0/">
<msg-id>000C297F-0536-11E3-E944-DF0951D0118E</msg-id>
<license>License has expired since 138 day(s)</license>
</header>
</SOAP:Header>
<SOAP:Body>
<SOAP:Fault>
<faultcode>MustUnderstand</faultcode>
<faultstring xml:lang="en-US">Do not understand method TAT_Email_Model_WebserviceOperation of type NSCUST</faultstring>
<faultactor>http://schemas.cordys.com/1.0/email</faultactor>
<detail>
<cordys:FaultDetails xmlns:cordys="http://schemas.cordys.com/General/1.0/">
<cordys:LocalizableMessage xmlns:cordys="http://schemas.cordys.com/General/1.0/">
<cordys:MessageCode xmlns:cordys="http://schemas.cordys.com/General/1.0/" />
</cordys:LocalizableMessage>
</cordys:FaultDetails>
</detail>
</SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>
</Response>
</ErrorDetails>
You have bound it to the wrong service container, you have to attach it to the Notification Service Container.
The error tells you that the current handling service container cannot handle requests of type NSCUST. This is available in the implementation of the webservice.
NOTE: you license has been expired on that server. With the License Manager in Cordys you can update it.

Problem in generating complex types while using XML Data Binding

I am using XML Data Mapping and having a problem with generating complex types while using it.
If i am having an XML like below its working fine
<?xml version="1.0" standalone="yes" ?>
<Sample>
<connection>
<item Name="ABC">123</item>
<item Name="XYZ">123</item>
<item Name="MNO">123</item>
</connection>
<connection>
<item Name="ABC">123</item>
<item Name="XYZ">123</item>
<item Name="MNO">123</item>
</connection>
</Sample>
I am getting complex types as SampleType, ConnectionType and ItemType.
But if i have the XML like
<?xml version="1.0" standalone="yes" ?>
<Sample>
<connection>
<item Name="ABC"/>
<item Name="XYZ"/>
<item Name="MNO"/>
</connection>
<connection>
<item Name="ABC"/>
<item Name="XYZ"/>
<item Name="MNO"/>
</connection>
</Sample>
I am getting complex types as SampleType, ConnectionType, ItemType, ItemType2, ItemType22, ItemType222, ItemType2222, and ItemType22222 i.e., ItemTypes were equal to number of items present in the XML.
Why this is happening and how can i solve this problem?.
It is because the data mapper is not meant to infer data from an XML file (or better phrased XML document), but from an XML Schema.
An XML Schema describes the syntax an XML document should adhere to.
XML schema's can for instance be stored as XSD files, or DTD files.
So the first step you should take is to create an XSD schema.
You could start with generating an XSD from the XML, then polishing that XSD.
The online XML-2-XSD tool can help you with generating that XSD, but there are many more tools.
Then use that XSD in the data mapper, and you make a much better chance.
Note: XML types are defined differently than most programming languages, so you cannot always map your XML data types to Delphi. Your simple case will work, but as soon as you do recursion or null in XML, it can get pretty hairy.
Edit: added XSD sample for both XML documents.
I used XmlForAsp to infer the XSD so you have a head start.
The inferred XSD for both the first and second XML document is the same:
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Sample" type="SampleType" />
<xsd:complexType name="SampleType">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="connection" type="connectionType" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="connectionType">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" name="item" type="itemType" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="itemType">
<xsd:attribute name="Name" type="xsd:string" />
</xsd:complexType>
</xsd:schema>
--jeroen

Delphi 2007 isn't generating the XML I want to send to my Java-WS web service

I have a Java web service to which I've linked from a Delphi 2007 app using the WSDL Importer. Setting it up has been a rocky road but I'm almost there!
I now have the situation where my arrays aren't being serialized in a way that my Java web service can consume. I've written the same app in .Net to test it out (it works fine) and the XML I'm looking to generate looks like this: -
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body xmlns:NS2="http://path.to.service">
<NS1:addActivities xmlns:NS1="http://path.to.service/">
<login href="#1"/>
<project xsi:type="xsd:string">PROJ001</project>
<activities>
<id xsi:type="xsd:string">DELPHITEST</id>
<name xsi:type="xsd:string">This is a test</name>
</activities>
<activities>
<id xsi:type="xsd:string">DELPHITEST2</id>
<name xsi:type="xsd:string">This is another test</name>
</activities>
</NS1:addActivities>
<NS2:login id="1" xsi:type="NS2:login">
<database xsi:type="xsd:string">My_database</database>
<password xsi:type="xsd:string">neverUmind</password>
<username xsi:type="xsd:string">bob</username>
</NS2:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
However, the XML that Delphi generates is as follows: -
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body xmlns:NS2="http://path.to.service/">
<NS1:addActivities xmlns:NS1="http://path.to.service/">
<login href="#1"/>
<project xsi:type="xsd:string">PROJ001</project>
<activities xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="NS2:activity[2]">
<item href="#2"/>
<item href="#3"/>
</activities>
</NS1:addActivities>
<NS2:login id="1" xsi:type="NS2:login">
<database xsi:type="xsd:string">My_database</database>
<password xsi:type="xsd:string">neverUmind</password>
<username xsi:type="xsd:string">bob</username>
</NS2:login>
<NS2:activity id="2" xsi:type="NS2:activity">
<id xsi:type="xsd:string">DELPHITEST</id>
<name xsi:type="xsd:string">This is a test</name>
</NS2:activity>
<NS2:activity id="3" xsi:type="NS2:activity">
<id xsi:type="xsd:string">DELPHITEST2</id>
<name xsi:type="xsd:string">This is another test</name>
</NS2:activity>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Basically, I need Delphi to stop creating activity elements within the activities element and instead just put each ID and Name inside the an activities element (as .Net does and Java seems to expect).
I've buggered about with the InvRegistry.RegisterInvokeOptions and the RemClassRegistry.RegisterSerializeOptions but none of the combinations seem to work. To be honest I'm on the verge of writting my own XML parser for this as it's taking way to long to figure out. However, if anyone has any suggestions on how this should work I'd be very grateful.
Surely somebody out there must have consumed a Java-WS web service via Delphi 2007 before :)
TIA
It seems the XMLDocument component in Delphi 2007 is broken. I've installed the Alcinoe component instead and that works a charm. That was only a week wasted ... grrrr

Resources