How to use the extruct.rdflibxml.host.HostLanguage function in extruct

To help you get started, we’ve selected a few extruct examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scrapinghub / extruct / extruct / rdflibxml / parse.py View on Github external
def lite_check() :
        if state.options.check_lite and state.options.host_language in [ HostLanguage.html5, HostLanguage.xhtml5, HostLanguage.xhtml ] :
            if node.tagName == "link" and node.hasAttribute("rel") and state.term_or_curie.CURIE_to_URI(node.getAttribute("rel")) != None :
                state.options.add_warning("In RDFa Lite, attribute @rel in  is only used in non-RDFa way (consider using @property)", node=node)
github scrapinghub / extruct / extruct / rdflibxml / options.py View on Github external
transformers               = [],
                       embedded_rdf               = True,
                       vocab_expansion            = False,
                       vocab_cache                = True,
                       vocab_cache_report         = False,
                       refresh_vocab_cache        = False,
                       add_informational_messages = False,
                       check_lite                 = False,
                       experimental_features      = False
                       ) :
        self.space_preserve             = space_preserve
        self.transformers               = transformers
        self.processor_graph              = ProcessorGraph()
        self.output_default_graph        = output_default_graph
        self.output_processor_graph        = output_processor_graph
        self.host_language                 = HostLanguage.rdfa_core
        self.vocab_cache_report            = vocab_cache_report
        self.refresh_vocab_cache        = refresh_vocab_cache
        self.embedded_rdf                = embedded_rdf
        self.vocab_expansion            = vocab_expansion
        self.vocab_cache                = vocab_cache
        self.add_informational_messages = add_informational_messages
        self.check_lite                 = check_lite
        if check_lite :
            self.transformers.append(lite_prune)
        self.experimental_features      = experimental_features