1.15k likes | 1.46k Views
CIMTool Training. Using CIMTool to Validate CIM RDF/XML. Introduction. The purpose of this presentation is to describe the use of CIMTool for the definition of model profiles and the validation of RDF instance files, a.k.a. CIM/XML
E N D
CIMTool Training Using CIMTool to Validate CIM RDF/XML
Introduction The purpose of this presentation is to describe the use of CIMTool for the definition of model profiles and the validation of RDF instance files, a.k.a. CIM/XML The use of CIMTool for the development of XML Schemas is out of the scope of this presentation This presentation is intended to meet the needs of Texas Nodal market participants CIMTool Training
Contents Overview of the CIM, RDF and Profiles CIMTool and Eclipse Creating a CIMTool Project Importing a Schema Creating and Editing a Profile Importing a Profile Importing a Profile from a Data Dictionary Generating RDF Schemas Importing a Model Validating a Model Importing and Validating an Incremental Model Updating a Schema Miscellaneous CIMTool Training
CIM, RDF and Profiles CIMTool Training
What is the CIM? The Common Information Model (CIM) is a standard for the electric utility industry that is intended to provide an information model that can be used to describe information exchanges The core CIM is an IEC standard: IEC 61970-301 There are other standards (e.g. IEC 61968 for distribution) that leverage or extend the CIM The CIM is a UML model composed of packages that describe a unique subject Each package describes a set of classes A class describes a set of attributes and relationships with other objects CIMTool Training
What is RDF? Resource Descriptor Format (RDF) is an XML dialect that is a W3C recommendation RDF is used to make statements about resources in the form of subject-predicate-object expressions (called triples) RDF Schema files describe the classes, attributes and relationships of an information model and typically use a .rdfs extension RDF instance files describe object instances, and typically use a .xml extension RDF incremental files describe changes to a set of object instances as described by an instance file, and typically use a .xml extension CIMTool Training
How is RDF used in CIM? IEC 61970-501 describes a ‘Common Information Model Resource Description Framework (CIM RDF) Schema’ IEC 61970-452 describes a ‘CIM Transmission Network Model Exchange Profile’ that leverages RDF IEC 61970-552-4 describes ‘CIM XML Model Exchange Format’ CIMTool Training
RDF Statements Value Resource (instance) Property or Resource CIMTool Training
Universal Resource Identifier (URI) Resources are identifies using URIs A URI identifies either: • A name (URN) • A location (URL) A portion of a URI is identified by a URI and a fragment: • URI#fragment Four forms/combinations: • Full (e.g. http://myuri.org/ontology#fragment) or relative (e.g. myuri.org/ontology#fragment) • With or without fragment 9 CIMTool Training
RDF(S) Syntax Schema file: • Class: Used in RDF Schema to define a new class • Resource: Root class for all resources • Property: Class of all properties • Datatype: Identifies data types • subClassOf: Specializes a class • range: Limits the valuesof a property • type: Identifies the class of an individual • about: Describes an existing resource • Description: Used for property/value pairs about a resource Instance file: • ID: Identifies a new resource • about: Describes an existing resource • Description: Used for property/value pairs about a resource CIMTool Training
CIM XML Schemas: Describe the model in terms of classes, associations and properties are defined using RDF Instance files: Describe objects that make up an electrical network in accordance with the RDF schema Incremental files: Describe the changes to an instance file in terms of additions and deletions in both forward and reverse directions CIMTool Training
Instance RDF Example <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cim="http://iec.ch/TC57/CIM-generic#"> <cim:IEC61970CIMVersion rdf:ID="_301"> <cim:IEC61970CIMVersion.version>cim6197011v09</cim:IEC61970CIMVersion.version> <cim:IEC61970CIMVersion.date>2007-06-12</cim:IEC61970CIMVersion.date> </cim:IEC61970CIMVersion> <cim:ACLineSegment rdf:ID="_7814201"> <cim:Conductor.gch>0</cim:Conductor.gch> <cim:Conductor.bch>.0002914</cim:Conductor.bch> <cim:Conductor.r>3.416</cim:Conductor.r> <cim:Conductor.x>27.749</cim:Conductor.x> <cim:Conductor.length>95</cim:Conductor.length> <cim:IdentifiedObject.name>AMHE400MARCLINE</cim:IdentifiedObject.name> <cim:IdentifiedObject.localName>SEG1</cim:IdentifiedObject.localName> <cim:ConductingEquipment.BaseVoltage rdf:resource="#_400000302"/> <cim:Equipment.MemberOf_EquipmentContainer rdf:resource="#_487038201"/> </cim:ACLineSegment> <cim:ACLineSegment rdf:ID="_7842201"> <cim:Conductor.gch>0</cim:Conductor.gch> <cim:Conductor.bch>.0003356</cim:Conductor.bch> <cim:Conductor.r>3.926</cim:Conductor.r> <cim:Conductor.x>31.986</cim:Conductor.x> <cim:Conductor.length>100</cim:Conductor.length> <cim:IdentifiedObject.name>AMHE400BOWMLINE</cim:IdentifiedObject.name> <cim:IdentifiedObject.localName>SEG1</cim:IdentifiedObject.localName> <cim:ConductingEquipment.BaseVoltage rdf:resource="#_400000302"/> <cim:Equipment.MemberOf_EquipmentContainer rdf:resource="#_487036201"/> </cim:ACLineSegment> CIMTool Training
Incremental RDF Example <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cim="http://iec.ch/TC57/2007/CIM-schema-cim12#" xmlns:dm="http://iec.ch/2002/schema/CIM_difference_model#"> <dm:DifferenceModel rdf:about=""> <dm:reverseDifferences rdf:parseType="Statements" xml:base="ABB40bus"> <rdf:Description rdf:about="#_7842201"> <cim:Conductor.r>3.926</cim:Conductor.r> <cim:Conductor.x>31.986</cim:Conductor.x> </rdf:Description> </dm:reverseDifferences> <dm:forwardDifferences rdf:parseType="Statements" xml:base="ABB40bus"> <rdf:Description rdf:about="#_7842201"> <cim:Conductor.r>3.93</cim:Conductor.r> <cim:Conductor.x>31.99</cim:Conductor.x> </rdf:Description> <cim:Substation rdf:ID="_789133201"> <cim:IdentifiedObject.localName>CIMT</cim:IdentifiedObject.localName> <cim:IdentifiedObject.name>CIMTEST</cim:IdentifiedObject.name> </cim:Substation> </dm:forwardDifferences> </dm:DifferenceModel> </rdf:RDF> CIMTool Training
What is a Profile? The set of classes, attributes and relationships in a profile is a subset of the classes, attributes and relationships found in a schema The cardinality of a relationship in a profile is either the same or more restrictive than the relationship in the schema A profile is often given a name (e.g. CPSM) Each profile will have an assigned namespace Profiles are also known as ‘contextual models’ Within CIMTool, profiles are managed using an OWL format, where a .owl extension is used Important to note that OWL is based upon RDF Profiles can be realized in a variety of forms, including but not limited to RDFS, XML Schema and HTML CIMTool Training
Information Models and Profiles CIMTool Training
CIMTool and Eclipse CIMTool Training
What is CIMTool? CIMTool is an Eclipse plugin It provides the means to: Define profiles from a UML model Import profiles from a spreadsheet Validate profiles Validate instance files against a profile Validate incremental files against an instance file and a profile Generate XML schemas from a profile Generate RDF schemas from a profile … and more CIMTool Training
What is Eclipse? Eclipse is a freely available, open source, integrated development environment (IDE) found at http://eclipse.org Think of Eclipse as a ‘workbench’ Eclipse is most commonly used for enterprise software development using Java, but it is extendible Eclipse capabilities are extended by a wide number of available ‘plug-ins’, developed by a wide number of sources Plugins available include: • CIMTool • XML Schema Editor • UML Editors • C, C++ compilers • … and much, much more Many commercial products are now delivered as Eclipse plug-ins CIMTool Training
Preparation for Installation You should have a PC running a recent version of Windows, Linux or Mac OS, with at least 1GB memory Recommend at least 2GB free disk space (much more is recommended if you will be working with large CIM network models) You need an internet connection, noting that there may be 200MB of downloads required for installation CIMTool Training
Installation Options • Install CIMTool and all of the necessary components in one step • Easiest approach if you do not have Java or Eclipse already installed • Install Java, Eclipse and then CIMTool • In the case where you may have Java and Eclipse already installed and need to install each component separately Note: In some corporate environments, firewalls and security processes may prevent a user from performing some of these steps. Consult your IT organization if you have trouble performing any of these steps. In particular, the Eclipse update facility does not work through many firewalls. For this reason, the one step version is more likely to work without assistance. CIMTool Training
Installing Java and Eclipse Java: • You need a Java runtime environment (JRE) • Java 5 JRE is currently recommended • If you don’t have one you can download from http://java.com Eclipse: • Go to http://eclipse.org • Click on ‘Download Eclipse’ • Pick a package to download, recommend ‘Eclipse Classic’ for Windows • You be prompted to download a zip from a mirror site, pick any one and save the zip file • Once the Eclipse zip file is downloaded, unzip (go to http://winzip.com if you don’t have an unzipper) it into a directory such as C:\eclipse • Create a desktop shortcut to the executable, e.g. C:\eclipse\eclipse.exe CIMTool Training
Starting Eclipse Click on the Eclipse icon The Eclipse startup dialog will appear Define a ‘workspace’ directory when prompted From the ‘Welcome’ page, click the ‘Go to the workbench’ icon (this page is often different on different versions) The workbench view will then appear CIMTool Training
Eclipse Workbench Initial default view before any projects are created Default installation supports Java development Help button is the key to adding new plug-ins to Eclipse The Package Explorer shows files and folders that exist in your workspace directory CIMTool Training
Eclipse Hints and Tips Updates Where the current version of Eclipse is 3.3.2, there are occasionally updates that may be of interest Eclipse can be updated using the ‘Help>Software Updates’ menu IDE Until you add specific plug-ins, Eclipse is primarily a Java integrated development environment (IDE) Views, Frames and Tabs You can change views using ‘Window>Show View’ You may change the arrangement of frames within the work bench You may have multiple files open at once, and switch between them using the tabs provided CIMTool Training
Eclipse Hints and Tips Files, Packages and Workspaces When you double-click on a file in the package explorer, it will be opened in the main work area frame It is important that you never add, modify or delete anything inside a workspace directory with tools other than Eclipse If there is ever a ‘resource out of sync’ problem, you can usually correct by using the ‘refresh’ option You may however safely read files directly from the workspace folder if needed CIMTool Training
Eclipse Plug-Ins Plug-ins provide capabilities to import, export, view, edit, process and/or create different types of files Eclipse plug-ins can be installed and updated from remote sites Eclipse is preconfigured with a set of remote sites where additional plug-ins can be found Other remote sites of particular interest include: CIMTool Provides the ability to use CIM models, schemas and profiles See http://cimtool.org for more information beyond what is covered in this presentation Add a new remote site for CIMTool at http://files.cimtool.org hyperModel Provides UML diagrams See http://xmlmodeling.com for details Add a new remote site for hyperModel at http://download.xmlmodeling.com/hyperModel/dev/updates/site.xml CIMTool Training
Installing CIMTool CIMTool is installed as a plug-in from a remote site Using the Eclipse update facility: • Start Eclipse • Find the update facility in the menus: ‘Help > Software Updates > Find and Install...’ • Select ‘Search for new features to install’ option and then select ‘Next’ • Select ‘New Remote Site …’ • On ‘New Update Site’ dialog set name=‘CIMTool’ and URL=‘http://files.cimtool.org’, then click ‘OK’ • Verify that the new site is now in the list and checked, and then click ‘Finish’ • On ‘Search Results’ dialog, check the box for CIMTool and then click ‘Next’ • Accept the license terms and click ‘Next’ • Click ‘Finish’ and wait for download to complete • On ‘Feature Verification’ dialog select ‘Install All’ and wait • When asked to restart Eclipse, click ‘Yes’ • Eclipse will then restart with the latest CIMTool plug-in installed CIMTool Training
Creating a CIMTool Project CIMTool Training
CIMTool Projects Each Eclipse project has a named folder in the Eclipse workspace directory Each CIMTool project will have four sub-folders: Incremental: for CIM XML incremental files in RDF format with a .xml extension Instances: for CIM XML instance files in RDF format with a .xml extension Profiles: for profile definitions, where Profile definitions are stored in an OWL format Log files, which may identify errors, are text files with a .log extension Depending upon the usage of CIMTool, there may also be HTML, RDFS and XSD files Schema: for the CIM model in XMI format with a .xmi extension Folders and files that have errors may include a red X on their associated icon CIMTool Training
Creating a New CIMTool Project Select ‘File > New > Project’ Select ‘CIMTool Project’ option Click ‘Next’ CIMTool Training
Creating a New CIMTool Project Name it – e.g. ‘ERCOT18’ Click ‘Finish’ This will create a new folder in your workspace directory CIMTool Training
Browsing the Project Click on arrow to the left of the desired project name in the Project Explorer to expand it See that project has a set of empty folders: Incremental, Instances, Profiles, Schema You can expand project sub-folders to see contents CIMTool Training
Importing a Schema CIMTool Training
Importing a Schema Schemas describe the classes, attributes and relationships defined by a UML model Anything defined by a profile MUST be described within the UML model Schemas must be in a suitable XMI format for import The XMI files are typically generated from the CIM UML model created/maintained using Rose or Enterprise Architect Schemas will be stored in the ‘Schema’ folder of the project There is typically one schema for a project, although there are cases where there may be more than one CIMTool Training
Schema in a UML Tool CIMTool Training
Exporting UML Model as XMI In Enterprise Architect select the top-level package Select Project > Import/Export > Export Package to XMI CIMTool Training
Exporting XMI from UML Tool Use export options shown to the right Export as UML 1.4 Unselect ‘Enable full EA Roundtrip’ Select ‘Unisys/Rose format’ option Enter file name for XMI file Click on Export button CIMTool Training
Schema Import within CIMTool Schemas are imported when creating a new CIMTool project Schemas can also be added to supplement an existing schema Schemas can also replace an existing schema, as in the case of a new CIM version CIMTool Training
Initial Schema Import Select ‘File > Import’ Note the different import options under CIMTool Select ‘Import Schema’ option Click ‘Next’ CIMTool Training
Initial Schema Import Browser to find XMI file to import Check the project into which it is to be imported Edit namespace (if necessary) Click ‘Finish’ CIMTool Training
Browsing the Project In Project Explorer, click on arrow to the left of project name to expand it Click on arrow to the left of Schema to expand it Note that schema is now present Right click on the file name to see properties and options CIMTool Training
Browsing the Project Model Project Model tab can be opened from Window > Show View > Other… and then by picking CIMTool/Project Model option The contents of the model as defined by the schema can then be viewed CIMTool Training
Key Icons Used Within CIMTool CIMTool Training
Creating and Editing a Profile CIMTool Training
Creating a New Profile There are three ways to create a new profile: Create it from scratch within CIMTool Import an OWL profile previously constructed using CIMTool Import the profile from a data dictionary spreadsheet Once created, profiles are stored in the ‘Profiles’ folder of the project A project may have many profiles Each profile will have a namespace This following slides describe the creation of a new profile using the edit capabilities within CIMTool CIMTool Training
Creating a New Profile Select ‘File > New > Other …’ CIMTool Training
Creating a New Profile Select ‘CIMTool Profile’ option Click ‘Next’ CIMTool Training
Creating a New Profile Click on checkbox for the desired project Assign a profile name (e.g. ERCOT18) Update namespace (if necessary) Click ‘Finish’ CIMTool Training
Browsing the Project Click on arrows in Project Explorer frame to expand folders Double click on the <profile>.owl file name in the Project Explorer to open it Click on the profile name in the Outline window In the Project Explorer frame you can always right click on a file name to see options CIMTool Training
Adding Classes to Profile First step is to add classes to profile Can browse through model on the right side of the Add/Remove tab Can select one or more classes on right side of Add/remove tab Classes are moved by clicking on < CIMTool Training