gfse / specif Goto Github PK
View Code? Open in Web Editor NEWSpecification Integration Facility - schema, constraint checker and examples
License: Apache License 2.0
Specification Integration Facility - schema, constraint checker and examples
License: Apache License 2.0
In the dataTypes section in the schema is a restriction included to have at least 1 item in the array.
I think there are some use cases where no data types are included - if a SpecIF file uses just standardized data types and other metatypes.
So I suggest to remove this constraint from the schema.
In SpecIF-level-3 (master branch), the titles of the values of an enumerated dataType shall be specified in different languages. Then, a viewer can display the enumerated values in the appropriate language.
The specification may be viewed completely language-dependent:
@oalt :
Thanks for your effort to prepare the "semantics" folder. It is a good idea to provide some semantic guidelines: As you do, I believe that an agreed upon vocabulary makes the difference. And then, why not provide ready-to-use SpecIF-templates.
I would like to propose, however, to combine all x01_... files into a single one that is schema-compliant. Anyways, the resourceClasses need the dataTypes ...
In addition we could provide different templates for different purposes. For example we could provide a very simple template with just a resourceClass "requirement" having 4 propertyClasses in addition to the "full-fledged" template you have added. And perhaps somebody else has a different focus and supplies something different from the FMC fundamental model element types we both find useful for model integration. For example I recall a TdSE-2017 conference session by Markus Brandstätter proposing an "Artefaktmodell zur Verbesserung der Prozessmodellierung".
Finally, I propose to create a new file extension for templates, e.g. 'specift' and 'speciftz'. When importing, a new project id could be generated automatically (by convention) to assure that multiple projects based on the same template carry different identifiers.
What do you think?
We should include in the Concepts chapter of the specification a further section describing the approach of semantic model integration using the FMC elements as base.
Currently a 'resource' has an attribute ‚resourceType‘ and a 'statement' has an attribute ‚statementType‘; similarly 'hierarchy' and 'property'. The idea was to express with the attribute-name what it is. While this makes the data easier to read and to understand (who actually wants to do that ;-), it is more difficult to process.
Thus another approach: Anyways, the context defines what a valid value is in each case (a 'resource' needs a ‚resourceType‘ and so on). Thus a constraint check can easily ascertain that a meaningful reference has been made in a particular situation. From a programming point of view a polymorphic approach is by far preferrable: All instances of type 'resource', 'statement', 'hierarchy' and 'property' get a commonly named attribute 'type'. Then a common code can process all instance types without distinguishing the cases.
Opinions?
When merging models from different tools, the same element has different ids with all likelyhood. We should keep track of original ids, which can be used for searching or updating. As there can be more than one original id, it should be a list.
... starting with SpecIF v1.0
Today, a resource or statement instance may have redundant titles as native (top-level) attribute and as an element in the properties list. Similarly for descriptions.
@oalt proposes: Omit native title and description to omit potential redundancy. In future all properties including title and description must be specified as elements in the properties list.
In mechatronic systems (and others), a numeric value is often to be understood as measure of a unit, e.g. [m], [m/s] or [m^3/kg]. We haven't talked about this, yet. Where to specify a unit, dataType or propertyType? Both is basically possible, but if ranges are defined with the dataTypes, units should be as well.
This question will get at us at the latest when we want to transform SysML parametric models.
Opinion, @oalt, @oeichmann and @S-Ruesch ?
@oalt , you have provided a whole bunch of standard types to be used in different domains or for different purposes. Except for the basic ones, the files do not comply with the schema.
When using 'extends' at the project level, we can indicate that together with another more basic file, there is complete and schema-compliant content.
Importing the HSUV Model of 2020-02-20, there are SpecIF:shows statements for Requirements, even though the statementClass does not allow it.
I have made a new logo design for SpecIF based on the colors @odungern had used in his logo design. The idea behind my design is
The used fonts are:
In trying mapping some data to SpecIF, I have the problem, that sometimes it would be very helpful, if you could add a Statement, that comes or goes from or to another statement. I provided just one example here:
This diagram expresses, that the two resources and the writes-Statement are shown on the diagram. Currently this is not possible to express. You just can split the Statement between the two resources in two parts and add a "Dummy"-resource in the middle as Object for the shows statement. I think this is not a good solution to solve the problem.
No change at the schema definition is necessary. It is just a semantic change/extension, that a subject- or object-key in a statement can also reference to statements and not just to resources.
Any other suggestions?
So far, an icon is a (short) string (e.g. allowing to specify UTF-8 characters), but @oalt proposes to allow a link to a graphical icon.
Today, the title of dataType, propertyClass, resourceClass and statementClass may have a single- or a multiple-language value. Therefore, a "select by title" operation is not straight forward.
@oalt proposes: Any title of dataType, propertyClass, resourceClass and statementClass can only be a string. The use of a vocabulary term is preferred.
I think it makes sense to have an additional value "System" in the Enumeration for the DT-Discipline to assign a requirement to a mechatronic System or a mechatronic control chain.
@odungern: What do you mean? Should we add such a value?
Definition reference: classDefinitions/102_EnumDatatypes.specif
In SpecIF some data elements are stored as flat lists on the top level (dataTypes, resourceClasses, statementClasses, hierarchyClasses), but the property classes and node elements from the hierarchies are no flat structures. They are inside the JSON as tree structures.
Provide all data elements as flat structures and use references - similar to the resourceReference in an node element to reference to the needed element. A storage in a simple list makes it easier to find an element (e.g. in a hierarchy), because you do not need to search a tree structure with a DFS or BFS algorithm. The second Advantage would be, that all data is represented in the same way in SpecIF: as an Array of objects on the top level.
In branch 'master' for v0.11.x and later, an item may have multiple revisions.
For items, the following rules apply:
For references (such as 'subject' or 'object' in statements), the following rules apply:
ToDo: Upgrade the constraint check to enforce these rules.
As dataTypes (among other purposes) serve for checking user input of SpecIF model editors, a type for URIs resp. URLs would help.
For example, if a property has a dataType 'xs:dateTime' or 'xs:integer', a key-by-key input check may determine using a regex whether the user-input is valid. The same is possible, if there is a dataType as known in XML, see xs:anyURI.
I think the properties "PC-SupplierStatus", "PC-SupplierComment", "PC-OemStatus", "PC-OemComment" in the property class IREB:Requirement are to specific for a general definition of requirements. So I would suggest to remove them for the moment.
As I thought about that, I had the idea if it makes sense to introduce an inheritance mechanism to SpecIF for the classes. This would provide the ability to define a general IREB:Requirement and a more special "Automotive Requirement" by just adding the newly needed properties ("PC-SupplierStatus", "PC-SupplierComment", "PC-OemStatus", "PC-OemComment") and inherit the rest from the base class. In the resource class we then have a new value e.g. extends: "RC-Requirement"
.
ReqIF has the possibility to define a default value to an ATTRIBUTE-TYPE. These are assumed by the instance ATTRIBUTE, if it has no value.
To allow a 100% transformation between ReqIF and SpecIF, we would need default values for propertyClasses.
Define the properties of the properties of the items in 'files', such as:
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "In case of a file, the id is ideally an absolute or relative URL.",
"$ref": "#/definitions/id"
},
"title": {
"type": "string"
},
"type": {
"description": "The media type of the file (formerly MIME-type) according to https://www.iana.org/assignments/media-types/media-types.xhtml.",
"type": "string"
},
"changedAt": {
"$ref": "#/definitions/dateTime"
},
"changedBy": {
"type": "string"
}
},
"required": [ "id", "title", "type", "changedAt" ]
}
}
An inheritance relation is helpful to maintain consistent class definitions. The idea is that an instance (e.g. resource) of a certain class (resourceClass in this case) may use all propertyClasses of the chain of ancestor classes. The same applies to subjectClasses and objectClasses in case of statements.
Hello @odungern !
In my IDE there is an example of a JSON configuration file where at the beginning a property "$schema" with a schema reference is included.
Example:
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:60827",
"sslPort": 44393
}
}, ...
What do you think - should we include such a property in each SpecIF file as well?
Extend the data structure for nodes with a description item. All other data types have such a description:
"description": {
"type": "string"
}
I had missed that also in ReqIF, because when you implement tools and you have to verify that the generated data is correct, you have no possibility to store helpful information for human readers in the nodes. So the information in a nodes description item is not at first for a tool for display this information, but more for usage for testing and debugging purposes. Of course you can also use it to place helpful internal information for a different purpose at all.
The distinction between unformatted and formatted text comes from ReqIF. But thinking a little further brings me to the conclusion, that the distinction is irrelevant, because in practice there are formatted property values without formatting and unformatted property values may eventually be displayed as HTML. Also, Markdown is quite popular and a very good choice for formatting text; creating another datatype for Markdown doesn't make sense.
Therefore I propose to eliminate the dataType 'xhtml'. It must be possible to reformat the content without changing the dataType. If someone wants to use the text values, he may decide what to do: strip the formatting to get plain text, convert the formatting to or from Markdown resp. XHTML.
@oalt @oeichmann @S-Ruesch : What do you think?
Oskar
Rework and finalize the Diagram Interchange specification using SVG and metadata for SpecIF release 1.1
See XML Schema Part 2: Datatypes Second Edition, for example XSD:Boolean instead of xs:boolean.
In the class definitions I have created a new property class "dcterms:abstract" and applied it to the SpecIF:Diagram resource. The reason for this is, that I searched for a possibility to separate the representation of the diagram image (SVG, PNG etc.) information from a descriptional text. E.g. in UML-tools you have the graphical diagram and additionally you can give a descriptional formatted text.
@odungern : Do you agree with that change?
I propose the following to make the schema more consistent:
@oalt : what do you think? Agree?
When writing the documentation of the SpecIF-metamodel some questions came in my mind:
We have discussed the requirement of multiple values per property. In fact, we already have all the ingredients: 'multiple' flag for enumerated values and value lists for multi-language strings.
However I propose to limit the variations of the "value" attribute and make it a list in all cases with one or more values.
What do you think: @oalt @oeichmann @S-Ruesch ?
The Tutorial 6: 'Very Simple Model (FMC)' shows following diagram:
When I open the SpecIF viewer at https://specif.de/apps/view#view=doc;project=ACP-Very-Simple-Model-FMC;node=N-MEl-50fbfe8f0029b1a8016ea86245a9d83a, I get following output:
That means, no diagram is shown at all.
The root resource (https://specif.de/apps/view#view=doc;project=ACP-Very-Simple-Model-FMC;node=N-Diagram-aec0df7900010000017001eaf53e8876) shows a diagram:
I really like that diagram as the syntax is 100% FMC Block Diagram (and not something custom as in tutorial 6)
Replace the multi-language title type for the File element with a simple string. It makes no sense here to have multi-language values for a file name or a URL.
In some code segments there is still an assumption that revisions are ascending integers.
For v1.0, 'changedAt' has been added to the required properties of a node (a nodes' item). Of course it will be set, when a node is created or modified.
But in fact. also the parent is changed, if a node is added or moved So also set the changedAt of the parent? I propose not to do so, also because at root level, there is no parent. This feel a little strange, when moving a node with PUT and specifying parent resp. predecessor. Then the moved node gets a new change date, but not the affected parent nodes.
Have an opinion, @oalt, @oeichmann and @S-Ruesch ?
Currently the revision is of type 'integer'. Thus, only sequential numbering is possible, but no branching. Also, document-databases have a more elaborated designation of revision.
Proposal: Change to 'string' and require that any newer revision is sorted in lexical order after any older.
@oalt : What do you think?
While it is not necessary to construct a working data set without node ids, the API needs it to offer operations to modify the hierarchy. Inserting a node needs a 'parent' (to create a lower level) or 'predecessor' (to insert at the same level), and the only unambiguous way to identify a node is by id (a resource may be referenced multiple times in a hierarchy).
Thus we should require a node id with v1.0.
Makes it sense to apply the property 'PC-Stereotype' to each SpecIF resource class or is this restricted to a specific subset? Which practical experience is available using the stereotype property?
Why are some numerical data type values in the Base Definitions restricted to a specific range?
When SpecIf is used as data format in a backend database, you will have many hierarchy objects containing requirement documents, BOMs etc.
Currently the hierarchy objects are just an array of hierarchies. Normally engineering data is organized and assigned to projects or specific systems. So it would be helpful, when you have a possibility to organize hierarchies in a tree structure with folders (headings), perhaps paragraphs and hierarchies, too - similar to file systems or repositories of MBSE tools.
Extend SpecIF with a new type called "repositories" on the same level as the other data types (e.g. hierarchies) and use the same concept as used for hierarchies to link to hierarchies using recursive nodes. Because of a hierarchy can also have properties, we can use a hierarchy object as well to represent a folder/directory.
Represent a revision as a tuple of data
Each revision is unique following this schema. The following rules shall be always followed by all SpecIF providers:
replaces
is empty, the element is the first one in the branch stated in the revisionreplaces
must always been setSome vocabulary elements have currently no title defined:
I would suggest to make the dcterms:title property mandatory for each Resource, so a tool can always use it as tree node name in a hierarchy view.
If no title is available in the source tool, a SpecIF adapter shall set a dummy title or an empty string.
Implement the schema for dataTypes with specific cases for each of the data-types with the respective properties using a "oneOf" structure.
Use Github actions to create a specification document automatically.
The idea is to provide separate schemata for the SpecIF elements, such as 'dataType', 'resourceClass' or 'resource'. Separate schemata can be used by an API to check incoming data.
There are two alternatives:
In SpecIF you can define the property values in different languages or use a simple string if you do not need multiple languages.
To ensure the compatibility and the ability to convert data from simple string to multi-language representation and vice versa, an information about the used language in the string value is required.
My first idea was to define a new JSON property "defaultLanguage" in the SpecIF heading data. But the problem is, that if you use SpecIF as API data you will not always get a complete SpecIF data structure, but just a Resource, Statement or Property alone.
So the proposal is to extend the "value" for a SpecIF property with a new JSON property "defaultLanguage":
"defaultLanguage": {
"description": "An IETF language tag such as 'en', 'en-US, 'fr' or 'de' - specifying the default language used for this value.",
"type": "string"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.