Home
IFC-to-RDF Converter User manual (version 0.1)
Contents
1. lt name gt osf lt file gt omn lt name gt omf lt file gt ofl lt name gt In Unix bash bin export ifc2rdf sh Icf lt file gt cf lt file gt isf lt file gt imf lt file gt osn lt name gt osf lt file gt omn lt name gt omf lt file gt ofl lt name gt Where Icf log config file lt file gt Logger configuration file properties or xml cf config lt file gt Configuration file isf input schema file lt file gt Source IFC schema file imf input model file lt file gt Source IFC model file osn output schema name lt name gt Target RDF store for the ontology optional osf output schema file lt file gt Target RDF file for the ontology optional omn output model name lt name gt Target RDF store for the model optional omf output model file lt file gt Target RDF file for the model optional ofl output file lang lt name gt RDF syntax type N3 default RDF XML RDF XML ABBREV N TRIPLE or TURTLE For example bash bin export ifc2rdf sh Icf config log4j xml cf config IfcAnalysis xml isf resources IFC2X3 TC1 exp imf samples sample ifc omf output sample rdf ofl N3 2 2 Sample script files In folder samples scripts of the release package there are some sample script files e export help sh or bat e export model to file 001 sh or bot e export schema 2x3 to agraph on allegrograph net sh or bot e export schema 2x3 to agraph on
2. EXPRESS format ISO 10303 11 2004 ISO 10303 21 2002 parsing schema parsing model net linkedbuildingdata Java objects ifc data model LinkedBuildingData net IfcModel objects net linkedbuildingdata ifc data schema IfcSchema exporting schema KH com hp hpl jena rdf model Model exporting model Java objects Jena models exporting Jena models RDF store RDF files Virtuoso Allegro and stores Graph Stardog etc RDF files RDF XML N3 etc Figure 1 IFC to RDF software functionalities 1 2 System requirements e Windows or Unix like OS e Java Platform Second Edition version 7 Java SE 7 JRE is needed for using the program in command line JDK is required for using the program API 1 http www iso org iso iso_catalogue catalogue_tc catalogue_detail htm csnumber 38047 http en wikipedia org wiki ISO_10303 21 3 http jena apache org documentation javadoc jena com hp hpl jena rdf model Model html http www w3 org 2008 01 rdf media types 5 http www oracle com technetwork java javase downloads index html e The release package already includes adapters for such triple stores as OpenLink Virtuoso Allegro Graph Stardog In case of exporting to another triple store you have to implement your own adapter see below 1 3 The package content The release package includes the following folders and subfolders e bin executable script files for Unix and Windows e config IF
3. OWL DL OWL Full OWL 2 RL OWL 2 Full Options ForceConvertBooleanValuesToString Indicates whether to force converting boolean values to strings even if the OWL profile supports Boolean type OWL DL OWL Full OWL 2 RL OWL 2 Full Options ForceConvertPropertyToObjectProperty Indicates whether to consider all properties as object properties even if the OWL profile supports data properties Options ExportDebuginfo Indicates whether to export debug info Ontology Prefix The short ontology prefix e g ifc Ontology NamespaceFormat The ontology namespace usually includes parameter SSchema VersionS Model Prefix The short model prefix e g mode Model NamespaceFormat The ontology namespace Read the conversion specification document for more details 4 1 2 Output Jena models The output Jena model is selected from the Jena model pool by the specified value of argument osn output schema name in case of exporting IFC schema or omn output model name in case of exporting IFC model An output Jena model configuration include the following parameters e the class name of the Jena model factory i e a class that extends the abstract class net linkedbuildingdata rdf modelfactory JenaModelFactoryBase and implements the following abstract methods 11 public abstract com hp hpl jena rdf model Model createModel throws Exception public abstract com hp hpl jen
4. a Java code sample in the release package samples java net linkedbuildingdata ifc convert ifc2rdf cli lfc2RdfExporter java 3 1 Parsing IFC schema file In order to import an IFC schema defined EXPRESS format file you must use the class ParserUtil as below see method parseSchema in the sample file fc2RdfExporter java import net linkedbuildingdata ifc convert text2ifc util ParserUtil import net linkedbuildingdata ifc data schema lfcSchema IfcSchema schema ParserUtil parseSchemaffilePath IfcSchema is a Java class which contains all information about entity select enumeration or defined data types of the EXPRESS schema Once the schema is imported successfully it will be added to the schema pool automatically To get a schema from that pool import net linkedbuildingdata ifc data schema lfcSchema import net linkedbuildingdata ifc data schema lfcSchemaPool IfcSchema schema IfcSchemaPool getSchema schemaVersion 3 2 Parsing IFC model file In order to import an IFC model defined STEP file you must use the class ParserUtil see method parseModel in the sample file fc2RdfExporter java import net linkedbuildingdata ifc convert text2ifc util ParserUtil import net linkedbuildingdata ifc data model IfcModel IfcModel model ParserUtil parseModel filePath An IfcModel contains all entities fcEntity which has literal attributes outgoing and incoming links with other entities 3 3 Converting IFC schema to Jena mo
5. murskain sh or bat e export schema 2x3 to file sh or bot e export schema 2x3 to stardog on localhost sh or bat e export schema 2x3 to virtuoso on localhost sh or bot e export schema 4 to file sh or bat It is easy to understand what these scripts do from their names Every script is available in two versions batch file for the Windows family OS and shell file for Unix like systems 3 Using IFC to RDF Converter in your Java program The following JAR files must be included in the Java class path commons codec 1 6 jar Apache Commons Codec API general encoding decoding algorithms commons lang3 3 1 jar Apache Commons Lang API extra functionality for classes in java lang jena arq 2 9 2 jar Apache Jena ARQ API A SPARQL processor for Jena jena core 2 7 2 jar Apache Jena Core API Core RDF API jena iri 0 9 2 jar Apache Jena IRI API supports for International Resource Identifiers in Jena log4j 1 2 16 jar Apache Log4J API supports logging net linkedbuildingdata common 1 0 jar LinkedBuildingData net Common API common utilities net linkedbuildingdata ifc common 1 0 jar LinkedBuildingData net IFC Common API common utilities for IFC net linkedbuildingdata ifc convert ifc2rdf 1 0 jar LinkedBuildingData net IFC 2 RDF API conversion from in memory IFC object model to Jena model net linkedbuildingdata ifc convert step2ifc 1 0 jar LinkedBuilding
6. name UserName value admin gt lt param name Password value admin gt lt param name Modelld value IFC gt lt params gt lt jenaModel gt lt jenaModel name Stardog1 default true gt lt class gt net linkedbuildingdata rdf modelfactory stardog StardogJenaModelFactory lt class gt lt params gt lt param name ServerUrl value http localhost 5822 gt lt param name UserName value admin gt lt param name Password value admin gt lt param name Modelld value IFC gt lt params gt lt jenaModel gt lt jenaModelPool gt 4 2 The logging configuration file The Ifc2RdfExporter program uses Apache Log4J API for logging messages The logging configuration is usually written in XML format but can also be written in Java properties or JSON format The included logging xml file in this release package is configured so that the program will logs only messages at INFO WARNING and ERROR levels to the console and some specific logging files for common messages messages from the parser and the converter To enable debug messages of the converter or other program layers you need to modify the logging properties For example lt logger name net linkedbuildingdata ifc convert gt lt level value debug gt lt appender ref ref FILE PARSER gt 12 lt logger gt Please read the Apache Logging Services manua configure it 1 http logging apache org log4j 1 2 manual html 119 to u
7. C 2 RDF configuration and logging configuration files e docs user manuals e lib Java archive JAR files o agraph JAR files for AllegroGraph API o virtuoso JAR files for Virtuoso API e resources EXPRESS schemas of IFC2x3 TC1 and IFC4 e samples sample files o java sample Java code o scripts sample shell for Unix and batch files for Windows 1 4 Copyright and feedback The IFC to RDF converter was created by Nam Vu Hoang at Department of Computer Science and Engineering of Aalto University School of Science Helsinki Finland under the guidance of D Sc Tech Seppo T rm in the DRUM research effort Distributed Transactional Building Information Management 2010 2014 belonging to the PRE project of RYM Oy and funded by Tekes The software package is freeware and is used as is The authors do not take any responsibility for its correctness For any suggestions feedbacks or requests please contact us e Seppo T rm seppo torma aalto fi e Nam Vu Hoang nam vuhoang aalto fi 6 http virtuoso openlinksw com 7 http www franz com agraph allegrograph 8 http stardog com 3 http www buildingsmart tech org specifications ifc releases ifc2x3 tc1 release 10 http www buildingsmart tech org specifications ifc releases ifc4 release 2 Using IFC to RDF Converter as an executable program 2 1 Command line In Windows bin export ifc2rdf bat Icf lt file gt cf lt file gt isf lt file gt imf lt file gt osn
8. Data net STEP 2 IFC API conversion from STEP file to in memory IFC object model net linkedbuildingdata ifc data 1 0 jar LinkedBuildingData net IFC Data API in memory IFC object schema and model structure net linkedbuildingdata ifc util 1 0 jar LinkedBuildingData net IFC Utils API high level specific IFC utilities net linkedbuildingdata rdf 1 0 jar LinkedBuildingData net RDF API RDF utilities net linkedbuildingdata rdf modelfactory 1 0 jar LinkedBuildingData net Jena Model Factory API base class for Jena model factory net linkedbuildingdata rdf modelfactory allegrograph 1 0 jar optional LinkedBuildingData net Jena Model Factory API for Allegro Graph creating and exporting Jena model to Allegro Graph net linkedbuildingdata rdf modelfactory virtuoso 1 0 jar optional LinkedBuildingData net Jena Model Factory API for Virtuoso creating and exporting Jena model to Virtuoso net linkedbuildingdata rdf modelfactory stardog 1 0 jar optional LinkedBuildingData net Jena Model Factory API for Stardog creating and exporting Jena model to Stardog slf4j api 1 6 4 jar Simple Logging Facade for Java SLF4J API slf4j log4j12 1 6 4 jar SLF4J Log4J bridge API xercesimpl 2 10 0 jar Xerces2 Java Parser API xml apis 1 4 01 jar XML APIs For more information see the JavaDoc of Ifc2RdfExporter software package will be published later Please find
9. IFC to RDF Converter User manual version 0 1 Document history Version Action Modifier Nam V Table of Contents 1 Generalinformati n asescnsenkense EEN EES 3 1 1 Ihe program PURPOSE Lunde TSN 3 1 2 System ge ln 3 1 3 The package content aaa a eegen geesde 4 1 4 Copyright and feedback ee aueh anni 4 2 Using IFC to RDF Converter as an executable program 5 2 1 Commandlin ee rn ekke 5 2 2 Sample script files sanere na Il 5 3 Using IFC to RDF Converter in your Java program 6 3 1 Parsing IFCschema lege ana Ee EE EE Ee H 3 2 Parsing IEC model file een a a deres 7 3 3 Converting IFC schema to Jena model 7 3 4 Converting IFC model to Jena model 8 3 5 Exporting Jena models to RDF file or RDF store 8 3 6 Creating user defined Jena model Tactorles 9 4 CONT BUPA ON EE 10 4 1 The common configuration file 10 4 2 The logging configuration le 12 1 General information 1 1 The program purpose IFC to RDF software is a configurable Java program with open API used for e Parsing IFC schema defined in EXPRESS format ISO 10303 11 2004 e Parsing IFC model defined in STEP File format ISO 10303 21 20022 e Exporting IFC schema and model to Jena models which can be later exported to triple stores or text files in different RDF formats e g RDF XML N3 Turtle e Importing IFC models from Jena models IFC models Text files STEP format IFC Schemas
10. a rdf model ModelgetModel throws Exception public abstract void release throws Exception e server access parameters such as ServerUrl UserName Password and Modelld In this release package there are a few Jena model factory classes e net linkedbuildingdata rdf modelfactory allegrograph AGJenaModelFactory creates a Jena model in AllegroGraph triple store e net linkedbuildingdata rdf modelfactory virtuoso VirtuosoJenaModelFactory creates a Jena model in OpenLink Virtuoso triple store e net linkedbuildingdata rdf modelfactory stardog StardogJenaModelFactory creates a Jena model in Stardog triple store lt jenaModelPool gt lt jenaModel name Memory1 default true gt lt class gt net linkedbuildingdata rdf modelfactory MemoryJenaModelFactory lt class gt lt jenaModel gt lt jenaModel name AllegroGraph1 default true gt lt class gt net linkedbuildingdata rdf modelfactory allegrograph AGJenaModelFactory lt class gt lt params gt lt param name ServerUrl value http localhost 10035 gt lt param name UserName value admin gt lt param name Password value admin gt lt param name Modelld value IFC gt lt params gt lt jenaModel gt lt jenaModel name Virtuoso1 default true gt lt class gt net linkedbuildingdata rdf modelfactory virtuoso VirtuosoJenaModelFactory lt class gt lt params gt lt param name ServerUrl value jdbc virtuoso localhost 1111 gt lt param
11. alse gt lt param name Options ForceConvertPropertyToObjectProperty value true gt 10 lt param name Options ExportDebuginfo value true gt lt param name Ontology Prefix value ifc gt lt param name Ontology NamespaceFormat value http linkedbuildingdata net schema SSchema VersionS gt lt param name Model Prefix value model gt lt param name Model NamespaceFormat value http linkedbuildingdata net model gt lt params gt lt converter gt lt converterPool gt The meanings and allowed values of the converter parameters are OwlProfile Specifies the used OWL profile must be one of the following values OWL1 Lite OWL1 DL OWL1 Full OWL2 EL OWL2_QL OWL2 BL OWL2 Full Options PrintPropertyCardinality Indicates whether to export property cardinalities Options PrintPropertyDomainAndRange Indicates whether to export property domains and ranges Options AvoidDuplicationOfPropertyNames Indicates whether to create sub properties to avoid duplication of property names Options PrintPropertyDomainAndRangeAsUnion Indicates whether to allow properties domains and ranges as unions Options ForceConvertRdfListToOloOrderedList Indicates whether to use olo OrderedList instead of rdf List Options ForceConvertEnumerationValuesToString Indicates whether to force converting enumeration values to strings even ifthe OWL profile supports enumerations
12. del Use the class fc2RdfExportUtil as below see method exportSchema in the sample file Ifc2RdfExporter java import net linkedbuildingdata ifc convert ifc2rdf util Ifc2RdfExportUtil import net linkedbuildingdata ifc convert ifc2rdf Ifc2RdfConversionContext import net linkedbuildingdata ifc data schema lfcSchema import net linkedbuildingdata ifc util ifc2rdf import com hp hpl jena rdf model Model Ifc2RdfExportUtil exportSchemaToJenaModel jenaModel ifcSchema conversionContext Parameter jenaModel has type com hp hpl jena rdf model Model see more in the documentation of Apache Jena The third parameter has type fc2RdfConversionContext When it is null or skipped the default context loaded from the configuration file is used see paragraph 4 1 http en wikipedia org wiki EXPRESS_ data_modeling_language http jena apache org documentation javadoc jena com hp hpl jena rdf model Model html B http jena apache org 3 4 Converting IFC model to Jena model Use the class Ifc2RdfExportUtil as below see method exportModel in the sample file Ifc2RdfExporter java import net linkedbuildingdata ifc convert ifc2rdf util Ifc2RdfExportUtil import net linkedbuildingdata ifc convert ifc2rdf Ifc2RdfConversionContext import net linkedbuildingdata ifc data model lfcModel import net linkedbuildingdata ifc util ifc2rdf import com hp hpl jena rdf model Model Ifc2RdfExportUtil exoortModelToJenaModel jenaModel ifcModel conver
13. el gt in section lt jenaModelPool gt lt xml version 1 0 encoding UTF 8 gt lt config gt lt Converters gt lt converterPool type lfc2Rdf gt lt converter name enabled true default true gt lt converter gt lt converter name enabled true default false gt lt converter gt lt converterPool gt lt Jena Model factory gt lt jenaModelPool gt lt jenaModel name enabled true default true gt lt jenaModel gt lt jenaModel name enabled true default false gt lt jenaModel gt lt jenaModelPool gt lt config gt 4 1 1 IFC to RDF conversion contexts The converter pool with type fc2Rdf includes all conversion contexts that can be used during the conversion process When there are more than one converter context is enabled with attribute enabled true then the converter tool will try to find fist context among them which is set as default with attribute default true If there is no default converter context then the first enabled context is used lt converterPool type lfc2Rdf gt lt converter name OWL2_RL enabled true default true gt lt params gt lt param name OwlProfile value OWL2_EL gt lt param name Options PrintPropertyCardinality value true gt lt param name Options PrintPropertyDomainAndRange value true gt lt param name Options AvoidDuplicationOfPropertyNames va
14. gurationPool getByName jenaModelFactoryName create a Jena model factory JenaModelFactoryBase jenaModelFactory JenaModelFactoryBase getFactory configuration Model jenaModel outputSchemaJenaModelFactory createModel As mentioned above the following methods export IFC schemas and models to Jena models A Jena model can be in memory or not If the Jena model is not in memory then newly added triples will be automatically exported to the real triple store Jena models can be exported to text files by using method Model write outputStream formatLanguage or Model write writer formatLanguage where parameter formatLanguage defines the RDF text format for example RDF XML N TRIPLE TURTLE N3 etc For example see methods exportSchema and exportModel in sample file Ifc2RdfExporter java import java io FileWriter import net linkedbuildingdata common file FileManager FileWriter writer FileManager createFileWriter filePath jenaModel write writer N TRIPLE After using Jena model do not forget to release the Jena model factory import net linkedbuildingdata rdf modelfactory JenaModelFactoryBase jenaModelFactory release 3 6 Creating user defined Jena model factories This release package includes Jena model factories for creating instances of classes that implement interface com hp hpl jena rdf model e g default in memory model class com franz agraph jena AGModel virtuoso jena driver Vi
15. lue true gt lt param name Options PrintPropertyDomainAndRangeAsUnion value false gt lt param name Options ForceConvertRdfListToOloOrderedList value false gt lt param name Options ForceConvertEnumerationValuesToString value false gt lt param name Options ForceConvertBooleanValuesToString value false gt lt param name Options ForceConvertPropertyToObjectProperty value true gt lt param name Options ExportDebuginfo value false gt lt param name Ontology Prefix value ifc gt lt param name Ontology NamespaceFormat value http linkedbuildingdata net schema SSchema VersionS gt lt param name Model Prefix value model gt lt param name Model NamespaceFormat value http linkedbuildingdata net model gt lt params gt lt converter gt lt converter name OWL1_DL enabled true default false gt lt params gt lt param name OwlProfile value OWL1_DL gt lt param name Options PrintPropertyCardinality value true gt lt param name Options PrintPropertyDomainAndRange value true gt lt param name Options AvoidDuplicationOfPropertyNames value true gt lt param name Options PrintPropertyDomainAndRangeAsUnion value false gt lt param name Options ForceConvertRdfListToOloOrderedList value false gt lt param name Options ForceConvertEnumerationValuesToString value false gt lt param name Options ForceConvertBooleanValuesToString value f
16. nderstand more about Log4J mechanism and how to 13
17. rt Model or Stardog Model If you want to create a new Jena model factory you have to create a class which inherits from abstract class net linkedbuildingdata rdf modelfactory JenaModelFactoryBase and implements the its abstract methods see sample files in folder samples java net linkedbuildingdata rdf modelfactory allegrograph AGJenaModelFactory java stardog StardogJenaModelFactory java virtuoso VirtuosoJenaModelFactory java For example import com hp hpl jena rdf model Model import net linkedbuildingdata rdf modelfactory JenaModelFactoryBase public class XXXJenaModelFactory extends JenaModelFactoryBase Override public Model createModel throws Exception Override public Model getModel throws Exception Override public void release throws Exception 14 http jena apache org documentation javadoc jena com hp hpi jena rdf model Model html 5 http jena apache org documentation javadoc jena com hp hpl jena rdf model Model html 16 http www franz com agraph support documentation v4 javadoc index html 17 http docs openlinksw com jena 18 http docs stardog com java 4 Configuration 4 1 The common configuration file The common XML configuration file includes options of the conversion process The most important sections which are discussed below are IFC to RDF conversion contexts tags lt converter gt in section lt converterPool type Ifc2Rdf gt and output Jena models tags lt jenaMod
18. sionContext The third parameter has type Ifc2RdfConversionContext When it is null or skipped the default context loaded from the configuration file is used see paragraph 4 3 5 Exporting Jena models to RDF file or RDF store You can create a com hp hpl jena rdf model Model instance either by your own way or by using Jena model factories Configuration of the latter is specified in the configuration document see paragraph 4 Find a Jena model factory by a name and then create a Jena model see methods run loadConfiguration getJenaModelFactoryConfiguration and getJenaModelFactory in sample file Ifc2RdfExporter java import net linkedbuildingdata common config document ConfigurationDocument import net linkedbuildingdata common config ConfigurationPool import net linkedbuildingdata common config ConfigurationltemEx import net linkedbuildingdata rdf modelfactory config JenaModelFactoryPoolConfigurationSection import net linkedbuildingdata rdf modelfactory JenaModelFactoryBase import com hp hpl jena rdf model Model load the configuration document ConfigurationDocument load configFilePath get a Jena model factory configuration pool ConfigurationPool lt ConfigurationltemEx gt jenaModelFactoryConfigurationPool JenaModelFactoryPoolConfigurationSection getinstance getConfigurationPool get a Jena model factory configuration by name ConfigurationltemEx jenaModelFactoryConfiguration jenaModelFactoryConfi
Download Pdf Manuals
Related Search
Related Contents
miniDSP Balanced 2x4 Manual de instalación REV.3 - Open your garage door with your Adobe - The Rochester Computer Society, Inc Vigil Rigger`s Manual Ventam 85 Interlock and Gas Proving System User Guide La zone de stationnement résidentiel Préfecture Baumatic BHC925SS hob VU-430 Pfaff pfaff Sewing Machines User's Manual Copyright © All rights reserved.
Failed to retrieve file