<commit_before>#-------------------------------------------------------------------------------
# Name:        CIM translator
# Purpose:     translate dmtf cim model to rdf/owl
# Dependency:  rdflib version: 3.3.0-dev https://github.com/RDFLib/rdflib
#
# Author:      ShiZhan
#
# Created:     08/08/2012
# Copyright:   (c) ShiZhan 2012
# Licence:     Apache License, Version 2.0
#-------------------------------------------------------------------------------
#!/usr/bin/env python

import logging

# Configure how we want rdflib logger to log messages
_logger = logging.getLogger("rdflib")
_logger.setLevel(logging.DEBUG)
_hdlr = logging.StreamHandler()
_hdlr.setFormatter(logging.Formatter('%(name)s %(levelname)s: %(message)s'))
_logger.addHandler(_hdlr)

from rdflib.graph import Graph
from rdflib.term import URIRef, Literal, BNode
from rdflib.namespace import Namespace, RDF, RDFS, OWL, XSD

import time

from lxml import etree

def main():

    print "Loading CIM XML ..."

    # input CIM/XML model from all_classes.xml published on:
    # http://www.dmtf.org/standards/cim
    try:
        cim_souce = etree.parse('all_classes.xml')
    except etree.XMLSyntaxError, error_loading:
        print "error while loading."
        pass
<commit_msg>add argument for specifying XML model file.<commit_after>#-------------------------------------------------------------------------------
# Name:        CIM translator
# Purpose:     translate dmtf cim model to rdf/owl
# Dependency:  rdflib version: 3.3.0-dev https://github.com/RDFLib/rdflib
#
# Author:      ShiZhan
#
# Created:     08/08/2012
# Copyright:   (c) ShiZhan 2012
# Licence:     Apache License, Version 2.0
#-------------------------------------------------------------------------------
#!/usr/bin/env python

import logging

# Configure how we want rdflib logger to log messages
_logger = logging.getLogger("rdflib")
_logger.setLevel(logging.DEBUG)
_hdlr = logging.StreamHandler()
_hdlr.setFormatter(logging.Formatter('%(name)s %(levelname)s: %(message)s'))
_logger.addHandler(_hdlr)

from rdflib.graph import Graph
from rdflib.term import URIRef, Literal, BNode
from rdflib.namespace import Namespace, RDF, RDFS, OWL, XSD

import sys
import time

from lxml import etree

def main():

    if len(sys.argv)<2:
        print "cim2rdf [DMTF XML model]"
        exit(1)

    print "Loading CIM XML ..."

    # input CIM/XML model from all_classes.xml published on:
    # http://www.dmtf.org/standards/cim
    try:
        cim_souce = etree.parse(sys.argv[1])
    except etree.XMLSyntaxError, error_loading:
        print "error while loading."
        pass

{'fraction_non_alphanumeric': 0.2182373140022892, 'fraction_numerical': 0.014498283098054178, 'mean_word_length': 2.1666666666666665, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1135585', 'n_tokens_mistral': 857, 'n_tokens_neox': 808, 'n_words': 216}