Example #1
0
 EndOfExistence, TimeSpan, Place, InformationObject, Phase, VisualItem
from cromulent.vocab import Painting, add_art_setter, PrimaryName, Name, \
 CollectionSet, instances, aat_culture_mapping, AccessionNumber, Height, Width, \
 SupportPart, Gallery, MuseumPlace, Signature, BottomPart, \
 Description, RightsStatement, MuseumOrg, Purchase

factory.id_type_label = True
add_art_setter()

obj = Painting(
    "http://www.getty.edu/art/collection/objects/882/rembrandt-harmensz-van-rijn-the-abduction-of-europa-dutch-1632/",
    label="The Abduction of Europa",
    art=1)

# Title
obj.identified_by = PrimaryName(label="Title", value="The Abduction of Europa")
obj.identified_by = Name(label="ALternate Title",
                         value="El rapto de Europa (Published Title)")

prod = Production()
obj.produced_by = prod

# Collection
col = CollectionSet("http://www.getty.edu/art/collection/",
                    label="The J. Paul Getty Museum Collection")
obj.aggregated_by = col

# Artist info
artist = Actor(
    "http://www.getty.edu/art/collection/artists/469/rembrandt-harmensz-van-rijn-dutch-1606-1669/",
    label="Artist")
Example #2
0
# obj.identified_by = acc_num
# obj.identified_by = loc_num

# print (factory.toString(obj, compact=False))




# Example of Context for Non-URI Identifiers

from cromulent.vocab import Painting, AccessionNumber, add_art_setter
add_art_setter - 
acc_num = AccessionNumber("https://linked.art/example/identifier/9", value="P1998-27")
aggr = Aggregation("https://linked.art/example/set/15", label="Paintings Collection")
o = Painting("https://linked.art/example/object/47", label="Example Painting", art=1)
o.identified_by = acc_num
o.aggregated_by = aggr 
print (factory.toString(o, compact=False))





# Example of Titles

# from cromulent.vocab import Painting, PrimaryName, Name, add_art_setter
# add_art_setter()
# ptitle = "Self Portrait"
# atitle = "Portrait of the Artist"
# prim_name = PrimaryName("https://linked.art/example/name/16", value=ptitle)
# alt_name = Name("https://linked.art/example/name/18", value=atitle)