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

Develop #34

Merged
merged 4 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 46 additions & 16 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,18 @@ const CONFIG = {};
'DC.title',
// ReqIF 1.0 and 1.1 Implementation Guide:
'ReqIF.Name',
// RIF 1.1a Atego Exerpt:
'Object Heading',
// 'VALUE-Object Heading', // 'VALUE-' is now removed right at the beginning
/* // DocBridge Resource Director:
'DBRD.Name',
// ARCWAY Cockpit Copilot:
'Objektüberschrift',
'Name',
// carhs SafetyWissen:
'carhs.Title.en',
'carhs.Title.de', */
// RIF 1.1a Atego Exerpt:
'Object Heading',
// 'VALUE-Object Heading', // 'VALUE-' is now removed right at the beginning
/* // Glossary:
'carhs.Title.de',
// Glossary:
'Title.en',
'Title.de',
'Title.fr',
Expand Down Expand Up @@ -338,13 +338,14 @@ const CONFIG = {};
CONFIG.resClassFolder,
CONFIG.resClassParagraph,
'SpecIF:Condition',
'BPMN:parallelGateway',
'BPMN:exclusiveGateway',
'BPMN:inclusiveGateway',
'BPMN:boundaryEvent',
'BPMN:intermediateThrowEvent',
'BPMN:intermediateCatchEvent',
'BPMN:callActivity',
'bpmn:parallelGateway',
'bpmn:exclusiveGateway',
'bpmn:inclusiveGateway',
"bpmn:eventBasedGateway",
'bpmn:boundaryEvent',
'bpmn:intermediateThrowEvent',
'bpmn:intermediateCatchEvent',
'bpmn:callActivity',
"Archimate:OrJunction",
"Archimate:AndJunction"
];
Expand Down Expand Up @@ -389,16 +390,45 @@ const CONFIG = {};
// A list of statement types by title,
// is used for example to recognize a statement to create when importing an xls sheet:
CONFIG.statementClasses = [
"SpecIF:contains",
"SpecIF:satisfies",
"SpecIF:implements",
'IREB:refines',
'IREB:refinedBy',
'oslc_rm:satisfies',
'oslc_rm:satisfiedBy',
"oslc_rm:elaborates",
"oslc_rm:elaboratedBy",
"oslc_rm:specifies",
"oslc_rm:specifiedBy",
"oslc_rm:affectedBy",
"oslc_rm:trackedBy",
'oslc_rm:implements',
'oslc_rm:implementedBy',
'oslc_rm:validates',
'oslc_rm:validatedBy',
// 'oslc_rm:decomposes',
// 'oslc_rm:decomposedBy',
'IREB:refines',
'IREB:refinedBy',
'oslc_rm:decomposes',
'oslc_rm:decomposedBy',
"oslc_rm:constrains",
"oslc_rm:constrainedBy",
"SpecIF:dependsOn",
"SysML:traces",
"SysML:isDerivedFrom",
"SpecIF:duplicates",
"SpecIF:contradicts",
"SysML:isAssociatedWith",
"SysML:isComposedOf",
"SysML:isAggregatedBy",
"SysML:uses",
"SysML:extends",
"SysML:includes",
"SysML:isSpecializationOf",
"SysML:isGeneralizationOf",
"SpecIF:inheritsFrom",
"SpecIF:refersTo",
"SpecIF:sameAs",
"owl:sameAs",
"rdf:type",
'IR:refersTo'
];
/* // List of lists with equivalent resource types, e.g. in different notations or standards;
Expand Down
7 changes: 3 additions & 4 deletions src/config/locales/iLaH-de.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,10 @@ function LanguageTextsDe() {
self.SysML_isComposedOf = "ist Komposition von";
self.SpecIF_isAggregatedBy =
self.SysML_isAggregatedBy = "ist Aggregation von";
self.SpecIF_isGeneralisationOf =
self.SysML_isGeneralisationOf = "ist generalisiert von";
self.SpecIF_isGeneralizationOf =
self.SysML_isGeneralizationOf = "ist generalisiert von";
self.SpecIF_isSpecializationOf =
self.SpecIF_isSpecialisationOf =
self.SysML_isSpecialisationOf = "ist spezialisiert von";
self.SysML_isSpecializationOf = "ist spezialisiert von";
self.SpecIF_isSynonymOf = "ist Synonym von";
self.SpecIF_isInverseOf = // DEPRECATED
self.SpecIF_isAntonymOf = "ist Antonym von";
Expand Down
7 changes: 3 additions & 4 deletions src/config/locales/iLaH-en.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,10 @@ function LanguageTextsEn() {
self.SysML_isComposedOf = "is composed of";
self.SpecIF_isAggregatedBy =
self.SysML_isAggregatedBy = "is aggregated by";
self.SpecIF_isGeneralisationOf =
self.SysML_isGeneralisationOf = "is Generalization of";
self.SpecIF_isGeneralizationOf =
self.SysML_isGeneralizationOf = "is Generalization of";
self.SpecIF_isSpecializationOf =
self.SpecIF_isSpecialisationOf =
self.SysML_isSpecialisationOf = "is Specialization of";
self.SysML_isSpecializationOf = "is Specialization of";
self.SpecIF_isSynonymOf = "is synonym of";
self.SpecIF_isInverseOf = // DEPRECATED
self.SpecIF_isAntonymOf = "is antonym of";
Expand Down
7 changes: 3 additions & 4 deletions src/config/locales/iLaH-fr.i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,10 @@ function LanguageTextsFr() {
self.SysML_isComposedOf = "est compos� de";
self.SpecIF_isAggregatedBy =
self.SysML_isAggregatedBy = "est aggreg� de";
self.SpecIF_isGeneralisationOf =
self.SysML_isGeneralisationOf = "est generalis� de";
self.SpecIF_isGeneralizationOf =
self.SysML_isGeneralizationOf = "est generalis� de";
self.SpecIF_isSpecializationOf =
self.SpecIF_isSpecialisationOf =
self.SysML_isSpecialisationOf = "est specialis� de";
self.SysML_isSpecializationOf = "est specialis� de";
self.SpecIF_isSynonymOf = "est synonyme de";
self.SpecIF_isInverseOf = // DEPRECATED
self.SpecIF_isAntonymOf = "est antonyme de";
Expand Down
2 changes: 1 addition & 1 deletion src/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// construct main app:
var self = this;
self.version = 'v0.99.6';
self.version = 'v0.99.6.b';
self.specifVersion = '1.0';
// IE does not support ()=>{..} --> "syntax error" at load time.
self.init = function() {
Expand Down
20 changes: 12 additions & 8 deletions src/modules/cache.mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ function Project( pr ) {
return dta;

function itemsByVisibleId(L,vId) {
// return a list with all elements in L having a property
// containing a visible id with value vId;
// should only be one resulting element:
return forAll( L, (r)=>{
if( visibleIdOf(r)==vId ) return r;
});
Expand All @@ -528,14 +531,15 @@ function Project( pr ) {
const resourcesToCollect = [
{type: "SpecIF:BusinessProcess", flag:"collectProcesses", folder:CONFIG.resClassProcesses, folderNamePrefix:"FolderProcesses-"}
];
var r = itemById( dta.resources, dta.hierarchies[0].resource),
var r = itemById( dta.resources, dta.hierarchies[0].resource ),
rC = itemById( dta.resourceClasses, r['class'] ),
// singleHierarchyRoot = dta.hierarchies.length==1 && rC && CONFIG.hierarchyRoots.indexOf(rC.title)>-1;
prp = itemByTitle( r.properties, CONFIG.propClassType ),
// the type of the hierarchy root can be specified by a property titled CONFIG.propClassType
// or by the title of the resourceClass:
singleHierarchyRoot = dta.hierarchies.length==1 && (prp && CONFIG.hierarchyRoots.indexOf(prp.value)>-1
|| rC && CONFIG.hierarchyRoots.indexOf(rC.title)>-1);
singleHierarchyRoot = dta.hierarchies.length==1
&& (prp && CONFIG.hierarchyRoots.indexOf(prp.value)>-1
|| rC && CONFIG.hierarchyRoots.indexOf(rC.title)>-1);
return new Promise(
(resolve,reject)=>{
if( typeof(opts)!='object' ) { resolve({status:0}); return; };
Expand Down Expand Up @@ -570,7 +574,7 @@ function Project( pr ) {
}
);
// console.debug('collectResourcesByType',delL,prL);
resolve({status:0});

// 2. Delete any existing folders:
// (Alternative: Keep folder and delete only the children.)
self.deleteContent( 'node', delL )
Expand Down Expand Up @@ -1022,7 +1026,7 @@ function Project( pr ) {
};

// Execution gets here, unless a substitution has taken place;
// keep separate instances:
// thus add the new resource as separate instance:

// Note that in theory, there shouldn't be any conflicting ids, but in reality there are;
// for example it has been observed with BPMN/influx which is based on bpmn.io like cawemo.
Expand Down Expand Up @@ -1483,7 +1487,7 @@ function Project( pr ) {
return new Promise(
(resolve,reject)=>{
// console.debug('createContent', ctg, item );
switch( ctg ) {
/* switch( ctg ) {
// case 'resource':
// case 'statement':
// case 'hierarchy':
Expand All @@ -1493,9 +1497,9 @@ function Project( pr ) {
// if current user can create an item, he has the other permissions, as well:
// addPermissions( item );
// item.createdAt = new Date().toISOString();
// item.createdBy = item.changedBy;
// item.createdBy = item.changedBy; */
cache( ctg, item )
};
// };
resolve({status:0})
}
);
Expand Down
1 change: 1 addition & 0 deletions src/modules/importAny.mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ modules.construct({
opts.deduplicate = true;
opts.addGlossary = true;
opts.collectProcesses = true;
// no break;
case 'update':
app.cache.selectedProject.update( dta, opts )
.progress( setProgress )
Expand Down
24 changes: 14 additions & 10 deletions src/modules/ioXls.mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,19 @@ function xslx2specif( buf, pN, chAt ) {
// console.debug( 'titleFromProps', res );
// get the title from the properties:
if( res.properties ) {
let a,A,pC;
for( a=0,A=res.properties.length;a<A;a++ ) {
pC = itemById( specif.propertyClasses, res.properties[a]['class'] );
// in many cases, this is perhaps faster than the concatenation of the lists:
if( pC
&& (CONFIG.titleProperties.indexOf( pC.title )>-1
|| CONFIG.idProperties.indexOf( pC.title )>-1 ))
return res.properties[a].value.stripHTML();
};
let a,pC;
// first try to find a property with title listed in CONFIG.titleProperties:
for ( a=res.properties.length-1; a>-1; a--) {
pC = itemById(specif.propertyClasses, res.properties[a]['class']);
if ( pC && CONFIG.titleProperties.indexOf(pC.title) > -1 )
return res.properties[a].value.stripHTML();
};
// then try to find a property with title listed in CONFIG.idProperties:
for ( a=res.properties.length-1; a>-1; a--) {
pC = itemById(specif.propertyClasses, res.properties[a]['class']);
if (pC && CONFIG.idProperties.indexOf(pC.title) > -1 )
return res.properties[a].value.stripHTML();
};
};
return '';
}
Expand Down Expand Up @@ -306,7 +310,7 @@ function xslx2specif( buf, pN, chAt ) {
// Inclule the property only if it has a significant value:
if( val )
res.properties.push({
title: pC.title, // needed for titleFromProps()
// title: pC.title,
class: pC.id,
value: val
});
Expand Down
Loading