-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Use -s/-n/-v property with an attribute with spaces #33
Comments
For -s this is probably not very obvious, plus there's an issue with -n/-v Names of attributes have to be surrounded by ' so they are looked up, and also you have to defeat your commandline method for quoting spaces in values. On Windows this means that for an attribute called However the processing for -n/-v is different, primarily because the -n/-v values are used two ways; they are put onto the oslc.select list to ensure values (or not) are retrieved for post-filtering, and this needs them to be surrounded by ' like -s values, BUT then during the postprocessing the -n/-v alues are used literally to match column headings which themselves don't have ', so they never match. At the moment if you can use explicit There's a simple hacky fix which is to require ' for -n/v names and strip ' off for post-processing, or a compromise hacky fix which is to detect whether they have ' and if not then add them. The best fix might be to require the ' and parse them like -s does, which will also detect if you misnamed the -n/-v value so I think that's my preferred solution. |
It worked with QM but when trying to use it on a Global configuration with RM it gives me the next error: oslcquery -J https://doorsng.grupoantolin.com:9443/ -U -P -A rm,gc,jts:jts23 -p "JEEP KM NA24 AmbLp" -E "JEEP KM NA24 AmbLp (GC)" -G "JEEP KM NA24 AmbLp MASTER V1.0" -s * -O Result.csv querying for gc config JEEP KM NA24 AmbLp MASTER V1.0 Traceback (most recent call last): |
That error is a new one on me; DB2 is complaining the query is just too big:
You've got past authentication because the DN shapes load, also the GC has been resolved to a configuration URL. A similar query (although for a much smaller project) works for me. I've now used oslcquery on very large multi-component queries (ELM on DB2) without hitting this. I just published version 0.17.0, can you update and try with this? |
0.17.0 should have resolved the -n/-v problems :-) |
What version+ifix are you using? |
Does it work any better if you don't use |
I am currently using the last one 0.17.0. It still gives the same error when trying to query for all the artifacts with artifact type==X inside the global configuration. So I tried to query for all the artifacts with artifact type==X inside each component in the project, with the local configuration for each of them. In most of the cases the query is accepted and the file generates, but I am getting errors in some of them, like this one F.E: oslcquery -J https://doorsng.grupoantolin.com:9443/ -A rm,gc,jts:jts23 -U -P -p "JEEP KM NA24 AmbLp" -C "JEEP KM NA24 AmbLp - MASTER Technical Specification" -s * -F "JEEP KM NA24 AmbLp - MASTER Technical Specification_V2.0" -O "Archivos/JEEP KM NA24 AmbLp - MASTER Technical Specification.csv" -q "((oslc:instanceShape='SYS Non-Functional Requirement') || (oslc:instanceShape='SYS Functional Requirement') || (oslc:instanceShape='SW Non-Functional Requirement') || (oslc:instanceShape='SW Functional Requirement') || (oslc:instanceShape='SW Low Level Requirement'))" The -n/ -v problems still exist so I dont know how to get the data. |
I have tried also without the query but the response is the same |
When quering into my STK requirements component I get a different error message: oslcquery -J https://doorsng.grupoantolin.com:9443/ -A rm,gc,jts:jts23 -U -P -p "JEEP KM NA24 AmbLp" -C "JEEP KM NA24 AmbLp STK" -s * -F "JEEP KM NA24 AmbLp STK_V2.0" -O "Archivos/JEEP KM NA24 AmbLp STK.csv" |
There may be several issues you're hitting, because you have three different failures. You're trying to query for all artifacts of a particular type across multiple contributions in a GC. Each of these type definitions has a unique local URI in each component. Unfortunately elmclient/oslcquery doesn't currently handle this. If your types all have RDF URIs, and if elmclient/oslcquery discovered the typesystem for each contribution then it may be possible to make this type of query work, but that's a lot of work and not in scope for elmclient which is really only intended as a demonstrator for the APIs, i.e. it's not intended as a comprehensive solution for all needs. However oslcquery should work in a local configuration, like your last example querying STK requirements component. It looks like something about the XML coming back from DOORS Next is badly formed at line 160 column 95. You can capture a complete trace of the communication by adding For this query, does it work any better if you don't use FYI your query specification Another FYI - those command lines are long/complicated aren't they. It's possible to put all the query information in an Excel spreadsheet and run all the queries from the spreadsheet, which requires an awful lot less typing. I use this as a basic regression test before each release. so for example I use |
Which version+ifix are you using? |
Thank you for your answer, In my example with STK requirements, it works without a problem if I use the same query without -s *, but then I cannot get the data I want because no attribute information gets displayed.
But both options give me problems right now. And about the length of the queries I use: Yes they are long and complicated, but I generate them with a python file looping through lists with my component names and stream names, so it would be pretty much the same as using the excel file. But thank you for your suggestion. |
I suspect there's some XML data with a bad (as far as elmclient is concerned) XML entity reference in one of the attributes selected by -s *, almost certainly the Primary Text, and probably created by pasting. Eliminate most other attributes by using -s |
oslcquery -J https://doorsng.grupoantolin.com:9443/ -A rm,gc,jts:jts23 -U -P -p "JEEP KM NA24 AmbLp" -C "JEEP KM NA24 AmbLp STK" -s "'Primary Text'" -F "JEEP KM NA24 AmbLp STK_V2.0" -O "Archivos/JEEP KM NA24 AmbLp STK.csv" -L TRACE GLC self=<elmclient._rm._RMComponent object at 0x000001BC6482BB50> name_or_uri='JEEP KM NA24 AmbLp STK_V2.0' 'Primary Text',dcterms:identifier,rm_nav |
That looks reminiscent of output from the version before I fixed the single-quote problem with A very similar command works for me using 0.17.0: oslcquery -A rm,gc -p rm_gc_p1 -s "'Primary Text'" -E gcproj -G "gccomp Initial Development" |
The line numbers in your traceback definitely don't match version 0.17.0 |
Discussed in #32
Originally posted by pablogarijo March 2, 2023
How can I use the -s/-n/-v property with an attribute with spaces (F.E "Planned SW Release Version" or 'Satisfied By Architecture Element')?
I am getting the next error:
dcterms:title,Planned SW Release Version,dcterms:identifier,r
^
Expected one of:
I have tried introducing the data with "", with '' and with both at the same time, but I keep getting errors.
oslcquery -J https://doorsng.grupoantolin.com:9443/ -U -P -p "" -C "SW_DALU" -s dcterms:title -F "SW_DALU_V3.0" -q "((oslc:instanceShape='SW Non-Functional Requirement') || (oslc:instanceShape='SW Functional Requirement'))" -n "Planned SW Release Version" -O result3.csv
this is my query
The text was updated successfully, but these errors were encountered: