• No se han encontrado resultados

3. MATERIAL Y MÉTODO

4.1. Casos no parentéticos

In the metamodel we talk about meta classes, properties, and attributes. For creating a model, these elements should be instantiated as follows.

Metamodel class usage guidelines All meta classes in SM4AM are defined

as instances of rdfs:Class. The definition of traceability related meta classes from Figure 3.15 is shown in Figure 3.16.

1 # Metamodel level

2 sm4am:SEList rdf:type rdfs:Class .

3 sm4am:TraceabilityEvidence rdf:type rdfs:Class . 4

5 sm4am:DataSource rdfs:subClassOf sm4am:TraceabilityEvidence . 6 sm4am:TraceOperation rdfs:subClassOf sm4am:TraceabilityEvidence .

Fig. 3.16: Example of Meta Class Definitions

For instantiating a meta class at the model level the step is:

• Create a tripleex:ModelClass rdf:type sm4am:MetaClass, where ex:Model- Class is the new class at the model level, sm4am:MetaClass is the SM4AM meta class that is to be instantiated, and therdf:type property links the previous two in an instance-type relation.

The example triples instantiating the previously defined meta classes are il- lustrated in Figure 3.17.

1 # Model level

2 ex:MDIntegration rdf:type sm4am:SEList . 3 ex:LinkedDataSource rdf:type sm4am:DataSource . 4 ex:IntegrationOperation rdf:type sm4am:TraceOperation . 5

6 ex:InsertLevel rdfs:subClassOf ex:IntegrationOperation .

Fig. 3.17: Example of Classes Instantiating Meta Classes

Then in turn, model classes have their instances. For instantiating a class at the instance level the step is:

• Create a triple ex:ClassInstance rdf:type ex:ModelClass, where ex:Class- Instance is an instance of ex:ModelClass and the rdf:type property links the previous two in an instance-type relation.

The example triples instantiating the previously defined model classes are illustrated in Figure 3.18.

1 # Instance level

2 ex:RegionIntegration rdf:type ex:MDIntegration . 3 ex:DBPedia rdf:type ex:LinkedDataSource . 4 ex:InsertRegion1 rdf:type ex:InsertLevel .

Fig. 3.18: Example of Class Instances

Metamodel property usage guidelines The situation with properties at the

metamodel level is a bit more complex. To be consistent with the RDF seman- tics and enable property typing between metamodel and model levels, each property in SM4AM is considered as both rdf:Property and rdfs:Class. This way, at the metamodel level it is used as property to link the meta classes and at the same time it can be instantiated at the model level with a prop- erty. Note that examples of similar property formulation can be found in the QB [27] and QB4OLAP [106] vocabularies. For the ease of distinction between properties at the metamodel from the model level, in the rest of this section we refer to a property at the metamodel level as a meta property. Furthermore, we refer to a property at the model level only as a property and to an instance of a property at the metadata instance level as a property instance.

Hence, all meta properties in SM4AM are defined as instances ofrdf:Pro- perty and instances of rdfs:Class. Moreover, as they are properties we also de- fine their domain and range meta classes using therdfs:domain and rdfs:range properties respectively. The definition of thesm4am:containsSE meta property from Figure 3.5 is shown in Figure 3.19.

As a property should be an instance of a meta property, its domain and range classes (at the model level) are to be instances of the domain and range meta classes of the meta property. For instantiating any of the meta properties at the model level the steps are:

4. A Method for Instantiating SM4AM

1 # Metamodel level

2 sm4am:containsSE rdf:type rdfs:Class, rdf:Property; 3 rdfs:domain sm4am:SEList; 4 rdfs:range sm4am:System .

Fig. 3.19: Example of Meta Property Definition

• Create a triple ex:modelProperty rdf:type rdf:Property, where ex:model- Property is the new property at the model that is created, rdf:Property is the concept of concept of property from RDFS, and therdf:type property links the previous two in an instance-type relation.

• Create a tripleex:modelProperty rdf:type sm4am:MetaProperty, where ex:- modelProperty is the new property at the model that is created, sm4am:- MetaProperty is any of the meta properties of SM4AM, and the rdf:type property links the previous two in an instance-type relation.

• Create a triple ex:modelProperty rdf:domain ex:ModelClass, where ex:- modelProperty is the new property at the model that is created, ex:Model- Class is a class at the model level instantiating the domain meta class of the meta property, and therdfs:domain property links the previous two in a property-domain class relation.

• Create a tripleex:modelProperty rdf:range ex:ModelClass, where ex:model- Property is the new property at the model that is created, ex:ModelClass is a class at the model level instantiating the range meta class of the meta property, and therdfs:range property links the previous two in a property-range class relation.

The example triples instantiating the previously defined meta property are illustrated in Figure 3.20.

1 # Model level

2 ex:source rdf:type rdf:Property, sm4am:containsSE; 3 rdfs:domain ex:MDIntegration; 4 rdfs:range ex:LinkedDataSource . 5 ex:operation rdf:type rdf:Property, sm4am:containsSE; 6 rdfs:domain ex:MDIntegration; 7 rdfs:range ex:IntegrationOperation .

Fig. 3.20: Example of Properties Instantiating a Meta Property

Then in turn, instances of the model properties have their instances. For instantiating any of the properties at the instance level the step is:

• Create a tripleex:ClassInstance1 ex:modelProperty ex:ClassInstance2, where ex:ClassInstance1 is an instance of the model class that corresponds to the property domain,ex:ClassInstance2 is an instance of the model class that corresponds to the property range, and theex:modelProperty prop- erty links the previous two in a relation with the semantics defined by the property at the model level.

The example triples instantiating the previously defined model properties are illustrated in Figure 3.21.

1 # Instance level

2 ex:RegionIntegration ex:source ex:DBPedia . 3 ex:RegionIntegration ex:operation ex:InsertRegion1 .

Fig. 3.21: Example of Property Instances

Metamodel attribute usage guidelines As briefly explained in Section 3,

the concept of attribute in SM4AM represents a meta property that links a meta class with a data type. The concrete data type should be defined at the model level and, therefore, this meta property defines only the domain while the range remains undefined. The definition ofsm4am:attribute is related to thesm4am:Evidence meta class in SM4AM. Hence, sm4am:attribute is defined with the triples presented in Figure 3.22.

1 # Metamodel level

2 sm4am:attribute rdf:type rdfs:Class, rdf:Property; 3 rdfs:domain sm4am:Evidence .

Fig. 3.22: Metamodel Attribute Definition

When it is instantiated with a property at the model level, the domain of the property should be a class that is an instance of the subclass of the sm4am:Evidence meta class (that is the domain of the attribute at the meta- model level). Furthermore, the range of the property refers to the class of a particular data type. For instantiating an attribute at the model level the steps are:

• Create a triple ex:modelProperty rdf:type rdf:Property, where ex:model- Property is the new property at the model that is created, rdf:Property is the concept of property from RDFS, and therdf:type property links the previous two in an instance-type relation.

• Create a tripleex:modelProperty rdf:type sm4am:attribute, where ex:model- Property is the new property at the model that is created, sm4am:attribute is the attribute concept of SM4AM, and therdf:type property links the previous two in an instance-type relation.

• Create a tripleex:modelProperty rdf:domain ex:ModelClass, where ex:model- Property is the new property that is created at the model level, ex:Model- Class is a class at the model level instantiating one of the sm4am:Evidence subclasses, and the rdfs:domain property links the previous two in a property-domain class relation.

4. A Method for Instantiating SM4AM

• Create a tripleex:modelProperty rdf:range ex:DataType, where ex:model- Property is the new property at the model that is created, ex:DataType is a class defining the data type at the model level (e.g., referring to the one of the RDF-compatible XSD types [28]), and therdfs:range property links the previous two in a property-range class relation.

The example triples instantiating the previously defined attribute are illus- trated in Figure 3.23. Continuing the previous examples, in Figure 3.23 we define the ex:levelIRI attribute for the ex:InsertLevel that has the xsd:anyURI datatype (see [28]) and indicates the IRI of a new level that will be added to the schema.

1 # Model level

2 ex:levelIRI rdf:type rdf:Property, sm4am:attribute; 3 rdfs:domain ex:InsertLevel; 4 rdfs:range xsd:anyURI .

Fig. 3.23: Example of Properties Instantiating an Attribute

Having the model defined, the instance level will contain the class in- stance linked by the property instance with a related (datatype) value. For instantiating an attribute at the instance level the step is:

• Create a tripleex:ClassInstance1 ex:modelProperty value, where ex:Class- Instance1 is an instance of the model class that corresponds to the prop- erty domain, value is a value of the datatype that corresponds to the property range, and therdf:modelProperty property links the previous two in a relation with the semantics defined by the property at the model level.

The example triples that instantiate the previously defined attribute as the model properties are illustrated in Figure 3.24.

1 # Instance level

2 ex:InsertRegion1 ex:levelIRI <http://regionIRIexample...> .

Fig. 3.24: Attribute Instantiation