#PathParam Vs #QueryParam vs #MatrixParam - jax-rs

I am newbie in RESTful jersey.
I would like to ask what is the different among '#PathParam' Vs '#QueryParam' vs '#MatrixParam' in jersey?.

Can't help you with the #MatrixParam but can give you an answer for the other two:
#PathParam: you use placeholder in the path. For example: #Path("/demo/{id}"). In this case the {id} part is your placeholde which you get with #PathParam("id")
#QueryParam: you use the normal uri query Syntax. For example: google.com?q=searchquery which translates to: #QueryParam("q") in your application

Related

Query parameter handling in karate framework

Is there any easy way to handle huge query param like below. Also I would like to know how can I do run time parameterisation for some values?
http://154.213.196.243:7941/v1/banking/Jumio/callback?callBackType=NetVerifyId&jumioIdScanReference=123abcde-1244-8571-3454-abcd12345567&merchantIdScanReference=66a9ff2e-d8ec-e811-a956-000d3ab3f117&verificationStatus=APPROVED_VERIFIED&idScanStatus=SUCCESS&id+ScanSource=API&idCheckDataPositions=OK&idCheckDocumentValidation=OK&idCheckHologram=OK&idCheckMRZcode=OK&idCheckMicroprint=OK&idCheckSecurityFeatures=OK&idCheckSignature=OK&transactionDate=2018-11-20T20%3A53%3A25.797Z&callbackDate=2018-11-20T20%3A53%3A25.797Z&idType=DRIVING_LICENSE&idCountry=GBR&idScanImage+=https%3A%2F%2Fnetverify.com%2Frecognition%2Fv1%2Fidscan%2F123abcde-1244-8571-3454-abcd12345567%2Ffront&idFirstName=ILARIA&idLastName=FURS&idDob=1976-12-23&idExpiry=2025-12-31&personalNumber=123456789&clientIp=xxx.xxx.xxx.xxx&idAddress=%7B%22country%22%3A%22USA%22%2C%20%22stateCode%22%3A%22US-OH%22%7D&idNumber=P12345&idStatus=TESTER961260SS9DL54&identityVerification=%7B%22similarity%22%3A%22MATCH%22%2C%22validity%22%3Atrue%7D HTTP/1.1
Yes. Read the docs: https://github.com/intuit/karate#param
For example:
* param callBackType = 'NetVerifyId'
and so on. And look at params where you can set all keys up as one single JSON and also do parameterization if needed, there are multiple possibilities: https://github.com/intuit/karate#params
See this example as well: dynamic-params.feature

Sparx EA : detect what database type currently using

Is there are way to detect what type of database currenlty is in use as project datasource?
Because I need to get some inner scripts information. And, in case of simple .EAP project, SQL-query would look like (because of Access db in use):
_repository.SQLQuery(string.Format(#"SELECT * FROM t_script WHERE Notes LIKE '*Script Name=""{0}""*';", scriptName));
But, in case of SQL server I need to execute (as you already guessed I bet) slighly different written query:
_repository.SQLQuery(string.Format(#"SELECT * FROM t_script WHERE Notes LIKE '%Script Name=""{0}""%';", scriptName));
So, is it possible?
UPD:
I found one option - looks like there are _repository.ConnectionString property which could be parsed
"SparxEaDatabase --- DBType=1;Connect=Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=SparxEaDatabase;Data Source=SOURCENAME;LazyLoad=1;"
Is there are more?
I would just look into Repository.RepositoryType. This will return for Example: JET, MYSQL, or SQLSVR.

Open CMIS - Querying string property results in weird behavior

I'm executing the following SQL query:
SELECT doc.cmis:description, doc.cmis:name
FROM cmis:document doc
WHERE IN_FOLDER(doc,'folderID')
This result in something like below:
doc.cmis:description = "this is description"
doc.cmis:name = "fileName"
Now, if I add following statements, it returns zero result:
and doc.cmis:description = 'this is description'
However, if I modify and-statement with following, it works:
and doc.cmis:description like '%'
If I add one character (but not two interestingly...) as below, it also works:
and doc.cmis:description like '%t%'
It's very interesting to note that and-statement work very well with doc.cmis:name (as well as other properties).
Does anyone have clue as to why this strange / mysterious behavior is occurring?
The specifications delegate to the implementer if the cmis:description is queryable or not.
Anyway, which Alfresco version are you using ? There was an issue/bug time ago, but this should be solved: The cmis:description field should be queryable, although I don't know if it's fixed in enterprise or community.
By the way, I am currently using Alfresco Community 4.2.f and I have the same problem.

SPARQL-DL query with owl-api

I'm writing an application using OWL-API and Hermit Reasoner. I would like to query data using SPARQL-DL by submitting query like:
PREFIX wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>
SELECT ?i
WHERE { Type(?i, wine:PinotBlanc) }
OR WHERE { Type(?i, wine:DryRedWine) }
Can I Do this directy with owl-api or should I use an external library (http://www.derivo.de/en/resources/sparql-dl-api/ ) ? ( I need something like
queryEngine.query(my_query); )
As in July 2013, the OWL-API does not support natively SPARQL-DL. You need to plug a third party library in order to make it work.
I am aware of two implementations (there's maybe more): One by Derivo (your link) and another one by Pellet.
I used OWL-API with Hermit and Pellet; both worked fine. The advantage of Pellet over Hermit is that it supports built-ins.
i.e. In Pellet, for some class Teenager, you can get seventeen year old persons using the following query:
Person and (hasAge value "17.0"^^double)
If you (or somebody) are still interested in, I can provide the Java class for it.
A pure OWL-API-impl cannot provide non-workaround way to support SPARQL since it is not graph based solution.
Now, starting v5, there is ONT-API which is jena-based OWL-API impl.

Endeca UrlENEQuery java API search

I'm currently trying to create an Endeca query using the Java API for a URLENEQuery. The current query is:
collection()/record[CONTACT_ID = "xxxxx" and SALES_OFFICE = "yyyy"]
I need it to be:
collection()/record[(CONTACT_ID = "xxxxx" or CONTACT_ID = "zzzzz") and
SALES_OFFICE = "yyyy"]
Currently this is being done with an ERecSearchList with CONTACT_ID and the string I'm trying to match in an ERecSearch object, but I'm having difficulty figuring out how to get the UrlENEQuery to generate the or in the correct fashion as I have above. Does anyone know how I can do this?
One of us is confused on multiple levels:
Let me try to explain why I am confused:
If Contact_ID and Sales_Office are different dimensions, where Contact_ID is a multi-or dimension, then you don't need to use EQL (the xpath like language) to do anything. Just select the appropriate dimension values and your navigation state will reflect the query you are trying to build with XPATH. IE CONTACT_IDs "ORed together" with SALES_OFFICE "ANDed".
If you do have to use EQL, then the only way to modify it (provided that you have to modify it from the returned results) is via string manipulation.
ERecSearchList gives you ability to use "Search Within" functionality which functions completely different from the EQL filtering, though you can achieve similar results by using tricks like searching only specified field (which would be separate from the generic search interface") I am still not sure what's the connection between ERecSearchList and the EQL expression above?
Having expressed my confusion, I think what you need to do is to use String manipulation to dynamically build the EQL expression and add it to the Query.
A code example of what you are doing would be extremely helpful as well.