A sentence-aligned natural language to Object Constraint Language (OCL) corpus, curated from the OMG OCL specification, the RM2PT project, and a small set of academic and online sources.
Companion dataset for DeepOCL: A deep neural network for Object Constraint Language generation (CAAI Transactions on Intelligence Technology, 2024). DOI: 10.1049/cit2.12207
The corpus reported in the paper is New Oclpairs/SUM.csv (1308 pairs).
| File | Rows | Columns | Notes |
|---|---|---|---|
New Oclpairs/SUM.csv |
1308 | NL, OCL, src | Canonical corpus reported in the paper. src references the source index in New Oclpairs/Index.txt. |
OCLpairs.csv |
1343 | NL, OCL | Working copy used during DeepOCL training. NL column carries the Generate OCL: task prefix (T5-style). Contains 35 pairs added after the paper was finalized. |
New Oclpairs/3 RM2PT_Sum.csv |
355 | NL, OCL, Tag, ... | Pairs extracted from the RM2PT project, with constraint kind tags (Definition, Postcondition, ...). |
New Oclpairs/1 LDY的.csv |
623 | NL, OCL | Pairs collected from UML/SysML/pssm specifications, Wahler (PhD thesis), and online OCL rule sets. Source attribution by row range is recorded in-file. |
New Oclpairs/2 OMG collected/ |
— | — | Raw extracts from OMG specification PDFs (AML, CCM, FUML, MARTE, QVT, SACM, SMOF, SysML, UML, UPR, etc.). |
New Oclpairs/Index.txt |
— | — | Source list for the OMG collection step. |
SUM.csv example:
NL,OCL,src A Constraint cannot be applied to itself.,not constrainedElement->includes(self),1.1 Elements that must be owned must have an owner.,mustBeOwned() implies owner->notEmpty(),1.1
OCLpairs.csv example (note the Generate OCL: prefix on NL):
NL,OCL Generate OCL: The first constrained element shall be a property,self.base_Constraint.constrainedElement->at(1).oclIsKindOf(Property)
To use OCLpairs.csv outside the original T5 training setup, strip the
Generate OCL: prefix from the NL column.
python import pandas as pd df = pd.read_csv("New Oclpairs/SUM.csv") print(len(df), df.columns.tolist())
bibtex @article{yang2024deepocl, title = {DeepOCL: A deep neural network for Object Constraint Language generation}, author = {Yang, ... and Liu, Yibo and ...}, journal = {CAAI Transactions on Intelligence Technology}, year = {2024}, doi = {10.1049/cit2.12207} }
Pairs were collected from:
- OMG specifications: UML, SysML, PSSM, AML, CCM, CCMP, CORP, FUML, MARTE, QVT, SACM, SMOF, UPR
- The RM2PT project (model-to-program transformation)
- Wahler, M. Using patterns to develop consistent design constraints (PhD thesis)
- xmldation.com OCL rules wiki
Full source index: New Oclpairs/Index.txt.
Apache 2.0. Original sources retain their respective licenses.