上一页 下一页

RDF / XML表示的示例

本主题提供了许多Resource Creation Factory XML的RDF / XML表示示例。

创建一个元素

使用Enterprise Architect GUID {259A54C2-6A89-46d7-AB7E-F192668010CA}在包中创建名为“Actor1”的Actor。

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"

                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                xmlns:dcterms="http://purl.org/dc/terms/"

                xmlns:foaf="http://xmlns.com/foaf/0.1/"

                xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">

     <oslc_am:Resource>

          <!--Required Properties-->

          <dcterms:title>Actor1</dcterms:title>

          <dcterms:type>Actor</dcterms:type>

          <ss:resourcetype>Element</ss:resourcetype>

          <ss:parentresourceidentifier>pk_{259A54C2-6A89-46d7-AB7E-F192668010CA}</ss:parentresourceidentifier>

     </oslc_am:Resource>

</rdf:RDF>

在Security Enabled模型中创建元素

在具有Enterprise Architect GUID {965A54C2-6A89-46d7-AB7E-F192668010CA}的包下的Security Enabled模型中创建一个名为“Class1”的类,并设置其Notes,Complexity和Version。

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"

                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                xmlns:dcterms="http://purl.org/dc/terms/"

                xmlns:foaf="http://xmlns.com/foaf/0.1/"

                xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">

     <oslc_am:Resource>

          <!--Required Properties-->

          <dcterms:title>Class1</dcterms:title>

          <dcterms:type>Class</dcterms:type>

          <ss:resourcetype>Element</ss:resourcetype>

          <ss:parentresourceidentifier>pk_{259A54C2-6A89-46d7-AB7E-F192668010CA}</ss:parentresourceidentifier>

         <!--Required in a Security Enabled Model-->

         <ss:useridentifier>{B6106F48-9659-4bff-B52A-C68F638BB1CE}</ss:useridentifier>

          <!--Optional Properties-->

          <dcterms:description>Created via OSLC</dcterms:description>

          <ss:complexity>Easy</ss:complexity>

          <ss:version>1.0</ss:version>

          <ss:useridentifier>{B6106F48-9659-4bff-B52A-C68F638BB1CE}</ss:useridentifier>

     </oslc_am:Resource>

</rdf:RDF>

创建BPMN2.0活动

使用Enterprise Architect GUID {259A54C2-6A89-46d7-AB7E-F192668010CA}在包中创建名为“检索零件清单”的BPMN 2.0活动。

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"

                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                xmlns:dcterms="http://purl.org/dc/terms/"

                xmlns:foaf="http://xmlns.com/foaf/0.1/"

                xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">

     <oslc_am:Resource>

          <!--Required Properties-->

          <dcterms:title>Retrieve Parts List</dcterms:title>

          <dcterms:type>BPMN2.0::Activity(UML::Activity)</dcterms:type>

          <ss:resourcetype>Element</ss:resourcetype>

          <ss:parentresourceidentifier>pk_{259A54C2-6A89-46d7-AB7E-F192668010CA}</ss:parentresourceidentifier>

     </oslc_am:Resource>

</rdf:RDF>

使用Stereotype创建一个用例

在包含Enterprise Architect GUID {259A54C2-6A89-46d7-AB7E-F192668010CA}的包中,使用Stereotype'enfirmator'创建一个名为“Validate Login”的UseCase。

 

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"

                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                xmlns:dcterms="http://purl.org/dc/terms/"

                xmlns:foaf="http://xmlns.com/foaf/0.1/"

                xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">

     <oslc_am:Resource>

          <!--Required Properties-->

          <dcterms:title>Validate Login</dcterms:title>

          <dcterms:type>UseCase</dcterms:type>

          <ss:resourcetype>Element</ss:resourcetype>

          <ss:parentresourceidentifier>pk_{259A54C2-6A89-46d7-AB7E-F192668010CA}</ss:parentresourceidentifier>

          <!--Optional Properties-->

          <ss:stereotype>

               <ss:stereotypename>

                    <ss:name>validator</ss:name>

               </ss:stereotypename>

          </ss:stereotype>

     </oslc_am:Resource>

</rdf:RDF>

创建属性

使用Enterprise Architect GUID {BE901CA9-FB3D-4af6-AEE2-B5CE6585F9D1}在类中创建名为“attribute1”的UML属性,并设置其类型,默认值和范围。

 

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"

                 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                 xmlns:dcterms="http://purl.org/dc/terms/"

                 xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">

     <ss:attribute>

          <!--Required Properties-->

          <ss:resourceidentifier>el_{BE901CA9-FB3D-4af6-AEE2-B5CE6585F9D1}</ss:resourceidentifier>

          <dcterms:title>attribute1</dcterms:title>

          <!--Optional Properties-->

          <ss:classifiername>int</ss:classifiername>

          <ss:defaultvalue>10</ss:defaultvalue>

     <ss:scope>Private</ss:scope>

</ss:attribute>

创建枚举标记值

使用Enterprise Architect GUID {BE901CA9-FB3D-4af6-AEE2-B5CE6585F9D1}在类上创建枚举类型标记值(值为'Val1','Val2'和'Val3')。

<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"

                 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                 xmlns:dcterms="http://purl.org/dc/terms/"

                 xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">

     <ss:taggedvalue>

          <!--Required Properties-->

          <dcterms:title>enumTag</dcterms:title>

          <ss:resourceidentifier>el_{BE901CA9-FB3D-4af6-AEE2-B5CE6585F9D1}</ss:resourceidentifier>

          <!--Optional Properties-->

          <ss:value>Val2</ss:value>

          <ss:type> Type=Enum;Values=Val1,Val2,Val3</ss:type>

          <ss:allowduplicates>false</ss:allowduplicates>

     </ss:taggedvalue>

</rdf:RDF>

创建依赖关系连接器

从Actor'Monitor1'(使用Enterprise Architect GUID {FACC69CC-F55E-4a81-9645-239DD50A94BB})创建一个名为'Actor_DepCon'的依赖关系连接器到Actor'Ector2'(使用Enterprise Architect GUID {81E80D25-F8BB-4fca -A819-317962FC0672})。

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"

                 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                 xmlns:dcterms="http://purl.org/dc/terms/" 

                 xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">

     <oslc_am:Resource>

          <!--Required Properties-->

          <dcterms:identifier>el_{FACC69CC-F55E-4a81-9645-239DD50A94BB}</dcterms:identifier>

          <ss:Dependency rdf:ID="ID" rdf:resource="http://localhost:480/firebird_model/oslc/am/resource/el_{81E80D25-F8BB-4fca-A819-317962FC0672}/"/>

     </oslc_am:Resource>

     <!--Optional Properties-->

     <rdf:Description rdf:about="#ID">

          <dcterms:title>Actor_DepCon</dcterms:title>

          <dcterms:type>Dependency</dcterms:type>

          <dcterms:description>Created via OSLC</dcterms:description>

          <ss:direction>Source → Destination</ss:direction>

     </rdf:Description>

</rdf:RDF>

创建BPMN 2.0 Sequence Flow连接器

从BPMN 2.0活动“检索部件列表”(使用Enterprise Architect GUID {85F77073-A93A-496b-A3C6-9C20EE33A065})创建BPMN 2.0序列流连接器到BPMN 2.0活动“存储顺序”(使用Enterprise Architect GUID) {A992EC7C-92C0-488e-B7B4-5FCBE87896AE})。

<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:oslc_am="http://open-services.net/ns/am#"

                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

                xmlns:dcterms="http://purl.org/dc/terms/" 

                xmlns:ss="http://www.sparxsystems.com.au/oslc_am#">

     <oslc_am:Resource>

          <!--Required Properties-->

          <dcterms:identifier>el_{85F77073-A93A-496b-A3C6-9C20EE33A065}</dcterms:identifier>

          <ss:ControlFlow rdf:ID="ID" rdf:resource="http://localhost:480/firebird_model/oslc/am/resource/el_{A9 GUID 92EC7C-92C0-488e-B7B4-5FCBE87896AE}/"/>

     </oslc_am:Resource>

     <rdf:Description rdf:about="#ID">     

          <dcterms:type>BPMN2.0::SequenceFlow(UML::ControlFlow)</dcterms:type>

          <!--Optional Properties-->

          <ss:direction>Source → Destination</ss:direction>

     </rdf:Description>

</rdf:RDF>