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

Fix typo assocation->association #930

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion code/concept_interpretation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class concept_type(Enum):
OBJECT_TYPING = auto()
# Packaged directed association class
DIRECTIONAL_BINARY = auto()
# Packaged intermediate class with normal undirected assocations
# Packaged intermediate class with normal undirected associations
DIRECTIONAL_GROUPED = auto()
# N-ary packaged association class
# currently, only approach with concept-introduced string labels
Expand Down
4 changes: 2 additions & 2 deletions code/process_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,15 @@ def write_class2(self, hc, xmi, UMLobject, schema, depth=0):

if depth < 1:

for rel in ['substitution','realization','dependency', 'assocation']:
for rel in ['substitution','realization','dependency', 'association']:

if rel == 'substitution':
dict_to_use = UMLobject.substitution_rel
reltype = 'depend'
elif rel == 'realization':
dict_to_use = UMLobject.realization_rel
reltype = 'real'
elif rel == 'assocation':
elif rel == 'association':
dict_to_use = UMLobject.assoc_rel
reltype = 'assoc'
else:
Expand Down
2 changes: 1 addition & 1 deletion code/shapes.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ ex:hasProperty a sh:SPARQLConstraint;


ex:hasNoDuplicateAssociation a sh:SPARQLConstraint;
sh:message "For assocation '{?resourceName}' - '{?psetName}' {?duplicates} duplicate associations are found" ;
sh:message "For association '{?resourceName}' - '{?psetName}' {?duplicates} duplicate associations are found" ;
sh:select """
PREFIX ex: <http://example.org/ifc43Shapes/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Expand Down
12 changes: 6 additions & 6 deletions code/to_express_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
xmi = xmi.doc(fn)

connector_data = namedtuple("connector_data", ("is_inverse", "inverse_order", "aggregation_type", "is_optional"))
assocation_data = namedtuple("assocation_data", ("own_end", "type", "other_end", "asssocation"))
association_data = namedtuple("association_data", ("own_end", "type", "other_end", "asssocation"))
# The order in which definitions are to appear in the Express schema
EXPRESS_ORDER=("TYPE", "ENUM", "SELECT", "ENTITY", "FUNCTION", "RULE")

Expand All @@ -47,15 +47,15 @@
is_optional = "ExpressOptional" in st.tags()
connectors[c.idref][other_cls] = connector_data(is_inverse, inverse_order, st.tags().get("ExpressAggregation"), is_optional)

# Extract some data from the assocations for use later on
assocations = defaultdict(list)
# Extract some data from the associations for use later on
associations = defaultdict(list)
for assoc in xmi.by_tag_and_type["packagedElement"]["uml:Association"]:
c1, c2 = assoc/'ownedEnd'
t1, t2 = map(lambda c: (c|"type").idref, (c1, c2))
tv1, tv2 = map(lambda t: xmi.by_id[t].name, (t1, t2))
cv1, cv2 = map(operator.attrgetter('name'), (c1, c2))
assocations[tv1].append(assocation_data(c2, xmi.by_id[t2], c1, assoc))
assocations[tv2].append(assocation_data(c1, xmi.by_id[t1], c2, assoc))
associations[tv1].append(association_data(c2, xmi.by_id[t2], c1, assoc))
associations[tv2].append(association_data(c1, xmi.by_id[t1], c2, assoc))

order = dict()
for o in xmi/"thecustomprofile:ExpressOrdering":
Expand Down Expand Up @@ -124,7 +124,7 @@ def generate_definitions():
other_name = xmi.by_id[other].name
[supertypes, subtypes][issub].append(other_name)

for end_node, end_node_type, other_end, assoc_node in assocations[c.name]:
for end_node, end_node_type, other_end, assoc_node in associations[c.name]:
try:
nm = end_node.name
assert nm
Expand Down
14 changes: 7 additions & 7 deletions code/xmi_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def unescape(s):
def float_international(s):
return float(s.replace(',', '.'))

assocation_data = namedtuple("assocation_data", ("own_end", "type", "other_end", "asssocation"))
association_data = namedtuple("association_data", ("own_end", "type", "other_end", "asssocation"))

def yield_parents(node):
yield node
Expand Down Expand Up @@ -335,13 +335,13 @@ def supertypes(self, eid):


def extract_associations(self, concepts=False):
# Extract some data from the assocations for use later on
# Extract some data from the associations for use later on

if concepts:
self.concepts = defaultdict(lambda: defaultdict(list))
self.concept_associations = defaultdict(lambda: defaultdict(list))
else:
self.assocations = defaultdict(list)
self.associations = defaultdict(list)
self.assoc_from = defaultdict(list)
self.assoc_to = defaultdict(list)

Expand Down Expand Up @@ -390,8 +390,8 @@ def extract_associations(self, concepts=False):
else:
self.assoc_to[from_id].append(to_id)

self.assocations[tv1].append(assocation_data(c2, self.xmi.by_id[t2], c1, assoc))
self.assocations[tv2].append(assocation_data(c1, self.xmi.by_id[t1], c2, assoc))
self.associations[tv1].append(association_data(c2, self.xmi.by_id[t2], c1, assoc))
self.associations[tv2].append(association_data(c1, self.xmi.by_id[t1], c2, assoc))

if concepts:

Expand Down Expand Up @@ -677,14 +677,14 @@ def substitute_predefined_type_with_containing_entity(ref_name):

# In case of asymmetric inverse relationships we need to find the
# proper target element.
assocs_by_name = self.assocations[c.name].copy()
assocs_by_name = self.associations[c.name].copy()
# count duplicate role names
counter = Counter()
counter.update(ass[0].name for ass in assocs_by_name)
# flag duplicates
duplicates = [ass[0].name is not None and counter[ass[0].name] > 1 for ass in assocs_by_name]
# look up suppression tag
suppressed = [self.xmi.tags['ExpressSuppressRel'].get(ass[2].id) == "YES" for ass in self.assocations[c.name]]
suppressed = [self.xmi.tags['ExpressSuppressRel'].get(ass[2].id) == "YES" for ass in self.associations[c.name]]
# apply filter
assocs_by_name = [a for a,d,s in zip(assocs_by_name, duplicates, suppressed) if not (d and s)]

Expand Down