Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Fedora Repository Views

...

But the angle one views the repository might also affect the number of entries seen. The above, recursive approach will always lead to one entry per data object. The remedy for this is to mark some classes as Entries for a certain view angle. This means that to compute the records for a given view angle, the view of all objects of a class that is an Entry should be computed. This is the view of the repository.

Fedora Implementation 

This section describes how the above could be implemented in Fedora. 

...

Add this relation to any content models that should describe entries for the view angle named GUI.

Code Block
languagexml
<view:isEntryForViewAngle xmlns:view="http://doms.statsbiblioteket.dk/types/view/0/2/#">GUI</view:isEntryForViewAngle>

...

The schema for the VIEW datastream is as follows:

Code Block
languagexml
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
targetNamespace="http://doms.statsbiblioteket.dk/types/view/0/2/#"
xmlns="http://doms.statsbiblioteket.dk/types/view/0/2/#"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
 
<xsd:element name="views" type="viewsType"/>
 
<xsd:complexType name="viewsType">
<xsd:sequence>
<xsd:element name="viewangle" type="viewType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
 
<xsd:complexType name="viewType">
<xsd:sequence>
<xsd:element name="relations" type="relationsType" minOccurs="0" maxOccurs="1"/>
<xsd:element name="inverse-relations" type="inverse-relationsType" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:complexType>
 
<xsd:complexType name="relationsType">
<xsd:sequence>
<xsd:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
 
<xsd:complexType name="inverse-relationsType">
<xsd:sequence>
<xsd:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
 
</xsd:schema>

...

This is an example of how the VIEW datastream could look for the view angle GUI.

Code Block
languagexml
<view:views xmlns:view="http://doms.statsbiblioteket.dk/types/views/0/1/#">
<view:viewangle name="GUI">
<view:relations>
<doms:hasFile xmlns:doms="http://doms.statsbiblioteket.dk/relations/default/0/1/#"/>
</view:relations>
<view:inverse-relations>
<doms:isPartOfCollection xmlns:doms="http://doms.statsbiblioteket.dk/relations/default/0/1/#"/>
</view:inverse-relations>
</view:viewangle>
</view:views>

...

The procedure to calculate the total view of a object is detailed in this bit of pseudo code. It basicly performs a depthfirst search of the objects. The order of the objects in the View does not carry any sort of meaning, and will be random.

Code Block
languagejava
Set<Object> visitedObjects;
 
List<Object> CalculateView(Object o) {
List<Objects> view = new List<Objects>();
 
if (visitedObjects.contain(o){
return view;
}
 
visitedObjects.add(o);
ContentModel c = o.getContentModel();
List<Relation> view-rels = c.getViewRelations();
List<Relation> object-rels = o.getRelations();
 
for (Relation r : object-rels){
if (view-rels.contain(r)){
view.addAll(CalculateView(r.getObject());
}
}
 
List<Relation> view-invrels = c.getInverseViewRelations();
List<Relation> object-invrels = o.getInverseRelations();
for (Relation r : object-invrels){
if (view-invrels.contain(r)){
view.addAll(CalculateView(r.getSubject());
}
}
 
return view;
}

...