{"id":20239529,"url":"https://github.com/opensourcebim/python-mvdxml","last_synced_at":"2025-09-11T17:47:26.486Z","repository":{"id":34782729,"uuid":"175832145","full_name":"opensourceBIM/python-mvdxml","owner":"opensourceBIM","description":"A mvdXML checker and w3c SPARQL converter, as an IfcOpenShell submodule or stand-alone.","archived":false,"fork":false,"pushed_at":"2024-01-19T21:25:30.000Z","size":163,"stargazers_count":34,"open_issues_count":4,"forks_count":12,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-10T19:58:30.366Z","etag":null,"topics":["bot","buildingsmart","ifc","ifcowl","industryfoundationclasses","linkedbuildingdata","linkeddata","mvd","mvdxml","owl","python","semanticweb"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opensourceBIM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-15T14:08:32.000Z","updated_at":"2024-11-15T03:11:18.000Z","dependencies_parsed_at":"2024-11-14T08:39:42.301Z","dependency_job_id":"c0fc72a9-ad91-4693-8313-88d9cb14e7ac","html_url":"https://github.com/opensourceBIM/python-mvdxml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/opensourceBIM/python-mvdxml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2Fpython-mvdxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2Fpython-mvdxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2Fpython-mvdxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2Fpython-mvdxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensourceBIM","download_url":"https://codeload.github.com/opensourceBIM/python-mvdxml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2Fpython-mvdxml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274681434,"owners_count":25330236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","buildingsmart","ifc","ifcowl","industryfoundationclasses","linkedbuildingdata","linkeddata","mvd","mvdxml","owl","python","semanticweb"],"created_at":"2024-11-14T08:39:29.710Z","updated_at":"2025-09-11T17:47:26.439Z","avatar_url":"https://github.com/opensourceBIM.png","language":"Python","readme":"## python-mvdxml\n\nA mvdXML checker and w3c SPARQL converter, as an IfcOpenShell submodule or stand-alone.\n\nWARNING: While this repository has many useful building blocks to build software around mvdXML and IFC, there are many mvdXML dialects and not all variants are likely to be fully supported.\n\n### Quickstart\n \n#### Extraction\n\n```python\nimport ifcopenshell\nfrom ifcopenshell.mvd import mvd\n\nmvd_concept = mvd.open_mvd(\"examples/wall_extraction.mvdxml\")\nfile = ifcopenshell.open(\"Duplex_A_20110505.ifc\")\n\nall_data = mvd.get_data(mvd_concept, file, spreadsheet_export=True)\n\nnon_respecting_entities = mvd.get_non_respecting_entities(file, all_data[1])\nrespecting_entities = mvd.get_respecting_entities(file, all_data[1])\n\n\n```\n\n```python\n# Create a new file\nnew_file = ifcopenshell.file(schema=file.schema)\nproj = file.by_type(\"IfcProject\")[0]\nnew_file.add(proj)\n\nfor e in respecting_entities:\n    new_file.add(e)\n\nnew_file.write(\"new_file.ifc\")\n```\n\n```python\n# Visualize results\nmvd.visualize(file, non_respecting_entities)\n```\n\n##### Validation\n\n~~~py\nimport ifcopenshell\n\nfrom ifcopenshell.mvd import mvd\nfrom colorama import Fore\nfrom colorama import Style\n\nconcept_roots = list(ifcopenshell.mvd.concept_root.parse(MVDXML_FILENAME))\nfile = ifcopenshell.open(IFC_FILENAME)\n\ntt = 0 # total number of tests\nts = 0 # total number of successful tests\n\nfor concept_root in concept_roots:\n    print(\"ConceptRoot: \", concept_root.entity)\n    for concept in concept_root.concepts():\n        tt = tt + 1\n        print(\"Concept: \", concept.name)\n        try:\n\n            if len(concept.template().rules) \u003e 1:\n                attribute_rules = []\n                for rule in concept.template().rules:\n                    attribute_rules.append(rule)\n                rules_root = ifcopenshell.mvd.rule(\"EntityRule\", concept_root.entity, attribute_rules)\n            else:\n                rules_root = concept.template().rules[0]\n            ts = ts + 1\n            finst = 0 #failed instances\n\n            for inst in file.by_type(concept_root.entity):\n                try:\n                    data = mvd.extract_data(rules_root, inst)\n                    valid, output = mvd.validate_data(concept, data)\n                    if not valid:\n                        finst = finst + 1\n                    print(\"[VALID]\" if valid else Fore.RED +\"[failure]\"+Style.RESET_ALL, inst)\n                    print(output)\n                except Exception as e:\n                    print(Fore.RED+\"EXCEPTION: \", e, Style.RESET_ALL,inst)\n                    print ()\n            print (int(finst), \"out of\", int(len(file.by_type(concept_root.entity))), \"instances failed the check\")\n            print (\"---------------------------------\")\n        except Exception as e:\n            print(\"EXCEPTION: \"+Fore.RED,e,Style.RESET_ALL)\n            print(\"---------------------------------\")\n    print(\"---------------------------------\")\nprint(\"---------------------------------\")\n\ntf = tt-ts # total number of failed tests\n\nprint (\"\\nRESULTS OVERVIEW\")\nprint (\"Total number of tests: \",tt)\nprint (\"Total number of executed tests: \", ts)\nprint (\"Total number of failed tests: \", tf)\n~~~\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensourcebim%2Fpython-mvdxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensourcebim%2Fpython-mvdxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensourcebim%2Fpython-mvdxml/lists"}