<commit_before>"""Deprecated; use Graph."""

from rdflib import Graph
from rdflib.Namespace import Namespace

INFORMATION_STORE = Namespace("http://rdflib.net/2002/InformationStore#")
CONTEXT = INFORMATION_STORE["Context"]
SOURCE = INFORMATION_STORE["source"]

class InformationStore(Graph):
    """
    Depcrecated. Use Graph instead.
    """

    
    def __init__(self, path=None, backend=None):
        if backend==None:
            backend = SleepyCatBackend()
        super(InformationStore, self).__init__(backend=backend)
        if path:
            self.open(path)
        
    def load(self, location, format="xml", publicID=None):
        location = self.absolutize(location)
        for id in self.subjects(SOURCE, location):
            context = self.get_context(id)
            self.remove_context(id)
        id = BNode()
        context = self.get_context(id)
        context.add((id, TYPE, CONTEXT))
        context.add((id, SOURCE, location))
        context.load(location, format, publicID)
        return context<commit_msg>added check_ methods<commit_after>"""Deprecated; use Graph."""

from rdflib import Graph
from rdflib.Namespace import Namespace

from rdflib.util import check_subject, check_predicate, check_object, check_context

INFORMATION_STORE = Namespace("http://rdflib.net/2002/InformationStore#")
CONTEXT = INFORMATION_STORE["Context"]
SOURCE = INFORMATION_STORE["source"]


class InformationStore(Graph):
    """
    Depcrecated. Use Graph instead.
    """
    
    def __init__(self, path=None, backend=None):
        if backend==None:
            backend = SleepyCatBackend()
        super(InformationStore, self).__init__(backend=backend)
        if path:
            self.open(path)
        
    def load(self, location, format="xml", publicID=None):
        location = self.absolutize(location)
        for id in self.subjects(SOURCE, location):
            context = self.get_context(id)
            self.remove_context(id)
        id = BNode()
        context = self.get_context(id)
        context.add((id, TYPE, CONTEXT))
        context.add((id, SOURCE, location))
        context.load(location, format, publicID)
        return context
{'fraction_non_alphanumeric': 0.11263736263736264, 'fraction_numerical': 0.003663003663003663, 'mean_word_length': 2.9872262773722627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6313932', 'n_tokens_mistral': 644, 'n_tokens_neox': 628, 'n_words': 140}