Skip to content
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

Parsing for relationships is confusing #552

Closed
jeromesimeon opened this issue Jun 10, 2020 · 3 comments
Closed

Parsing for relationships is confusing #552

jeromesimeon opened this issue Jun 10, 2020 · 3 comments
Labels
Type: Question ❓ Further information is requested

Comments

@jeromesimeon
Copy link
Member

Parsing for complex variables which are relationships is confusing.

cicero parse for variables involved in a relationships (https://templates.accordproject.org/[email protected])

bash-3.2$ cicero parse --template ~/git/cicero-template-library/src/acceptance-of-delivery
9:00:43 AM - info: Loading a default text/sample.md file.
9:00:47 AM - info:
{
  "$class": "org.accordproject.acceptanceofdelivery.AcceptanceOfDeliveryClause",
  "clauseId": "70d97b87-e23e-4edd-9c58-d66ca9bf1db9",
  "shipper": "Party A",
  "receiver": "Party B",
  "deliverable": "Widgets",
  "businessDays": 10,
  "attachment": "Attachment X"
}

shipper and receiver are not of type String but of type --> Organization. It is not easy to determine from the output. Also the content of the organization is not available to the runtime.

For reference the model is:

asset AcceptanceOfDeliveryClause extends AccordClause {
  --> Organization shipper
  --> Organization receiver
  o String deliverable
  o Long businessDays
  o String attachment
}
@jeromesimeon jeromesimeon added the Type: Question ❓ Further information is requested label Jun 10, 2020
@jeromesimeon jeromesimeon changed the title Parsing for relationships is cnfusing Parsing for relationships is confusing Jun 10, 2020
@jeromesimeon
Copy link
Member Author

Note that this issue has relevance to both the new design for Concerto relationships / identified classes (see Issue accordproject/concerto#181) and to the new parser (see Issue #547).

With the current development code for the new parser, we get:

bash-3.2$ ../markdown-cli/index.js transform --from markdown --to data --grammar ./test/data/acceptance-of-delivery/grammar.tem.md --ctoFiles ./test/data/acceptance-of-delivery/model.cto --input ./test/data/acceptance-of-delivery/sample.md 
9:11:08 AM - info:
{
  "$class": "org.accordproject.acceptanceofdelivery.AcceptanceOfDeliveryClause",
  "shipper": "resource:org.accordproject.organization.Organization#Party%20A",
  "receiver": "resource:org.accordproject.organization.Organization#Party%20B",
  "deliverable": "Widgets",
  "businessDays": 10,
  "attachment": "Attachment X",
  "clauseId": "1430b558-c8b1-4689-823a-c9e27843cc54"
}

@dselman
Copy link
Contributor

dselman commented Jun 10, 2020

Note that this issue has relevance to both the new design for Concerto relationships / identified classes (see Issue accordproject/concerto#181) and to the new parser (see Issue #547).

With the current development code for the new parser, we get:

bash-3.2$ ../markdown-cli/index.js transform --from markdown --to data --grammar ./test/data/acceptance-of-delivery/grammar.tem.md --ctoFiles ./test/data/acceptance-of-delivery/model.cto --input ./test/data/acceptance-of-delivery/sample.md 
9:11:08 AM - info:
{
  "$class": "org.accordproject.acceptanceofdelivery.AcceptanceOfDeliveryClause",
  "shipper": "resource:org.accordproject.organization.Organization#Party%20A",
  "receiver": "resource:org.accordproject.organization.Organization#Party%20B",
  "deliverable": "Widgets",
  "businessDays": 10,
  "attachment": "Attachment X",
  "clauseId": "1430b558-c8b1-4689-823a-c9e27843cc54"
}

I think this behaviour is correct. It is much more explicit and the URI scheme for the relationship allows the caller to retrieve the instance type and the id.

@jeromesimeon
Copy link
Member Author

This issue has been fixed using the new parser infrastructure and is fixed in the development version of Cicero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question ❓ Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants