Skip to content

Commit

Permalink
Working profile for linked.art examples
Browse files Browse the repository at this point in the history
  • Loading branch information
azaroth42 committed Jun 7, 2017
1 parent cec8626 commit ceab141
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
8 changes: 4 additions & 4 deletions cromulent/data/crm_vocab.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ P73_has_translation property translation has translation This property describes
P73i_is_translation_of property translation_of is translation of P130i_features_are_also_found_on E33_Linguistic_Object E33_Linguistic_Object P73_has_translation 10000 0
P74_has_current_or_former_residence property current_or_former_residence has current or former residence This property describes the current or former E53 Place of residence of an E39 Actor. \nThe residence may be either the Place where the Actor resides, or a legally registered address of any kind. E39_Actor E53_Place P74i_is_current_or_former_residence_of 10000 0
P74i_is_current_or_former_residence_of property current_or_former_residence_of is current or former residence of E53_Place E39_Actor P74_has_current_or_former_residence 10000 0
P75_possesses property possesses possesses This property identifies former or current instances of E30 Rights held by an E39 Actor. E39_Actor E30_Right P75i_is_possessed_by 10000 0
P75i_is_possessed_by property possessed_by is possessed by E30_Right E39_Actor P75_possesses 10000 0
P75_possesses property possesses possesses This property identifies former or current instances of E30 Rights held by an E39 Actor. E39_Actor E30_Right P75i_is_possessed_by 10000 1
P75i_is_possessed_by property possessed_by is possessed by E30_Right E39_Actor P75_possesses 10000 1
P76_has_contact_point property contact_point has contact point This property identifies an E51 Contact Point of any type that provides access to an E39 Actor by any communication method, such as e-mail or fax. E39_Actor E51_Contact_Point P76i_provides_access_to 10000 0
P76i_provides_access_to property provides_access_to provides access to E51_Contact_Point E39_Actor P76_has_contact_point 10000 0
P78_is_identified_by property time_identified_by is identified by This property identifies an E52 Time-Span using an E49Time Appellation. P1_is_identified_by E52_Time-Span E49_Time_Appellation P78i_identifies 10000 0
Expand Down Expand Up @@ -290,8 +290,8 @@ P118_overlaps_in_time_with property overlaps_in_time_with overlaps in time with
P118i_is_overlapped_in_time_by property overlapped_in_time_by is overlapped in time by E2_Temporal_Entity E2_Temporal_Entity P118_overlaps_in_time_with 10000 0
P119_meets_in_time_with property meets_in_time_with meets in time with This property indicates that one E2 Temporal Entity immediately follows another. \nIt implies a particular order between the two entities: if A meets in time with B, then A must precede B. This property is only necessary if the relevant time spans are unknown (otherwise the relationship can be calculated). \nThis property is the same as the "meets / met-by" relationships of Allen’s temporal logic (Allen, 1983, pp. 832-843). E2_Temporal_Entity E2_Temporal_Entity P119i_is_met_in_time_by 10000 0
P119i_is_met_in_time_by property met_in_time_by is met in time by E2_Temporal_Entity E2_Temporal_Entity P119_meets_in_time_with 10000 0
P120_occurs_before property occurs_before occurs before This property identifies the relative chronological sequence of two temporal entities. \nIt implies that a temporal gap exists between the end of A and the start of B. This property is only necessary if the relevant time spans are unknown (otherwise the relationship can be calculated).\nThis property is the same as the "before / after" relationships of Allen’s temporal logic (Allen, 1983, pp. 832-843). E2_Temporal_Entity E2_Temporal_Entity P120i_occurs_after 10000 0
P120i_occurs_after property occurs_after occurs after E2_Temporal_Entity E2_Temporal_Entity P120_occurs_before 10000 0
P120_occurs_before property occurs_before occurs before This property identifies the relative chronological sequence of two temporal entities. \nIt implies that a temporal gap exists between the end of A and the start of B. This property is only necessary if the relevant time spans are unknown (otherwise the relationship can be calculated).\nThis property is the same as the "before / after" relationships of Allen’s temporal logic (Allen, 1983, pp. 832-843). E2_Temporal_Entity E2_Temporal_Entity P120i_occurs_after 10000 1
P120i_occurs_after property occurs_after occurs after E2_Temporal_Entity E2_Temporal_Entity P120_occurs_before 10000 1
P121_overlaps_with property overlaps_with overlaps with This symmetric property allows the instances of E53 Place with overlapping geometric extents to be associated with each other. \nIt does not specify anything about the shared area. This property is purely spatial, in contrast to Allen operators, which are purely temporal. E53_Place E53_Place 10000 0
P122_borders_with property borders_with borders with This symmetric property allows the instances of E53 Place which share common borders to be related as such. \nThis property is purely spatial, in contrast to Allen operators, which are purely temporal. E53_Place E53_Place 10000 0
P123_resulted_in property resulted_in resulted in This property identifies the E77 Persistent Item or items that are the result of an E81 Transformation. \nNew items replace the transformed item or items, which cease to exist as units of documentation. The physical continuity between the old and the new is expressed by the link to the common Transformation. P92_brought_into_existence E81_Transformation E77_Persistent_Item P123i_resulted_from 10000 0
Expand Down
11 changes: 10 additions & 1 deletion cromulent/extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,27 @@
# can generate classes for any ontology

import inspect
from .model import Destruction, Activity, Purchase, MonetaryAmount, Actor, Place, \
from .model import Destruction, EndOfExistence, Activity, Purchase, MonetaryAmount, Actor, Place, \
Type, Dimension, SymbolicObject, Person, ManMadeObject, PhysicalObject, CRMEntity, \
InformationObject, ManMadeThing, BaseResource

# DestuctionActivity class as CRM has a Destruction Event and recommends multi-classing
# WARNING: instantiating this class in the default profile will raise an error

class DestructionActivity(Destruction, Activity):
_uri_segment = "Activity"
_type = ["crm:Destruction", "crm:Activity"]
_niceType = ["Destruction", "Activity"]
DestructionActivity._classhier = inspect.getmro(DestructionActivity)[:-1]

# And hence we make an EndOfExistence+Activity class
# for all activities that end existences
class EoEActivity(EndOfExistence, Activity):
_uri_segment = "Activity"
_type = ["crm:End_of_Existence", "crm:Activity"]
_niceType = ["EndOfExistence", "Activity"]
EoEActivity._classhier = inspect.getmro(EoEActivity)[:-1]

# New Payment Activity
Purchase._properties['offering_price'] = {"rdf":"pi:had_offering_price", "range": MonetaryAmount, "okayToUse": 1}
class Payment(Activity):
Expand Down
5 changes: 3 additions & 2 deletions cromulent/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,12 @@ def __setattr__(self, which, value):
else:
if self._factory.validate_properties or self._factory.validate_profile or self._factory_validate_range:
ok = self._check_prop(which, value)
elif isinstance(value, ExternalResource):
ok = 2
else:
# XXX: How does this work with _set_magic_resource below???
ok = 1

# Allow per class setter functions to do extra magic
# Allow per class/prop setter functions to do extra magic
if hasattr(self, which) and hasattr(self, 'set_%s' % which):
fn = getattr(self, 'set_%s' % which)
return fn(value)
Expand Down
7 changes: 4 additions & 3 deletions cromulent/vocab.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ def register_aat_dimensionUnit(name, id):
"AccessionNumber": {"parent": Identifier, "vocab": "aat", "id": "300312355"},
"LotNumber": {"parent": Identifier, "vocab": "aat", "id": "300404628"},

"PrimaryTitle": {"parent": Title, "vocab": "aat", "id": "300404670"},
"Inscription": {"parent": Mark, "vocab": "aat", "id": "300028702"},
"Signature": {"parent": Mark, "vocab": "aat", "id": "300028705"},
"PrimaryAppellation": {"parent": Appellation, "vocab": "aat", "id": "300404670"},

"Inscription": {"parent": LinguisticObject, "vocab": "aat", "id": "300028702"},
"Signature": {"parent": LinguisticObject, "vocab": "aat", "id": "300028705"},

"MaterialStatement": {"parent": LinguisticObject, "vocab": "aat", "id": "300010358"},
"DimensionStatement": {"parent": LinguisticObject, "vocab": "aat", "id": "300266036"},
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'data/key_order.json', 'data/context.jsonld']
},
test_suite="tests",
version = '0.2.7',
version = '0.3.0',
description = 'A library for mapping CIDOC-CRM classes to Python objects',
author = 'Getty Research Institute, Rob Sanderson',
author_email = '[email protected], [email protected]',
Expand Down
8 changes: 4 additions & 4 deletions utils/crm-profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
"P119i_is_met_in_time_by": 0,
"P11_had_participant": 0,
"P11i_participated_in": 0,
"P120_occurs_before": 0,
"P120i_occurs_after": 0,
"P120_occurs_before": 1,
"P120i_occurs_after": 1,
"P121_overlaps_with": 0,
"P122_borders_with": 0,
"P123_resulted_in": 0,
Expand Down Expand Up @@ -327,8 +327,8 @@
"P73i_is_translation_of": 0,
"P74_has_current_or_former_residence": 0,
"P74i_is_current_or_former_residence_of": 0,
"P75_possesses": 0,
"P75i_is_possessed_by": 0,
"P75_possesses": 1,
"P75i_is_possessed_by": 1,
"P76_has_contact_point": 0,
"P76i_provides_access_to": 0,
"P78_is_identified_by": 0,
Expand Down

0 comments on commit ceab141

Please sign in to comment.