View Source

{excerpt}Algorithm to precreate [Annotation Points|Annotation Design#Annotation Points]{excerpt}
The algorithm reuses "return complete MO" by Mitac.
Pseudo-code:
{noformat}
for each root in Museum_Object's
CreateAnnotationPoint(root,null,null,1);
CreateAnnotationPoints(root,root);

CreateAnnotationPoints(root,subject):
for each property of <subject> that is business-meaningful
counter = 1
CreateAnnotationPoint(root,subject,property,null,counter++); // (1)
for each object of <subject,property>
CreateAnnotationPoint(root,subject,property,object,counter++);
if not ObjectIsTerminal // literal or a skos:Concept
CreateAnnotationPoints(root,object)

CreateAnnotationPoint(root,subject,property,object,counter)
uri = AnnotationPointUri(root,subject,property,object,counter);
RdfInsert(uri,rdf:type,crm:E13_Attribute_Assignment);
RdfInsert(uri,rso:root,root);
if subject RdfInsert(uri,crm:P140_assigned_attribute_to,subject);
if property RdfInsert(uri,rso:property,property);
if object RdfInsert(uri,rso:object,object);
RdfInsert(uri,rso:P3_has_title,AnnotationTitle(root,subject,property,object));
RdfInsert(uri,rso:P2_annotation_status,rst-annotation-status:invisible);

AnnotationPointUri(root,subject,property,object,counter)
property ? subject + "/" + LocalName(property) + "/a/" + counter :
root + "/a/1";
{noformat}

Discussion:
# Jana, I think we should forego APs of type (s,p) to avoid clutter
#- We need Link APs only of type (s,p,o) (!)
#- When creating annotation over AP (s,p,o), this selects "other_object=o" by default, but the user can select other_object=null