def setUp(self): self.graph = Graph(namespace_manager=ns.ns_manager) self.person_uri = ns.D["test"] self.create_strategy = SimpleCreateEntitiesStrategy( HashIdentifierStrategy(), person_uri=self.person_uri) self.crosswalker = FundingCrosswalk( identifier_strategy=self.create_strategy, create_strategy=self.create_strategy)
def default_execute(orcid_id, namespace=None, person_uri=None, person_id=None, skip_person=False, person_class=None, confirmed_orcid_id=False): # Set namespace set_namespace(namespace) this_identifier_strategy = HashIdentifierStrategy() this_person_uri = URIRef(person_uri) if person_uri \ else this_identifier_strategy.to_uri(FOAF.Person, {"id": person_id or orcid_id}) # this_create_strategy will implement both create strategy and identifier strategy this_create_strategy = SimpleCreateEntitiesStrategy(this_identifier_strategy, skip_person=skip_person, person_uri=this_person_uri) crosswalker = PersonCrosswalk(create_strategy=this_create_strategy, identifier_strategy=this_create_strategy) return crosswalker.crosswalk(orcid_id, this_person_uri, person_class=person_class, confirmed_orcid_id=confirmed_orcid_id)
def setUp(self): self.strategy = HashIdentifierStrategy()