@@ -0,0 +1,1660 @@
+%22%22%22%0ACreated RDF from matched CSV.%0A%22%22%22%0A%0Aimport sys%0Aimport csv%0A%0Afrom rdflib import Graph, URIRef, Literal, Namespace%0Afrom rdflib.namespace import RDF, RDFS, OWL%0Afrom rdflib.resource import Resource%0A%0ADATA = Namespace(%22http://example.org/data/journals/%22)%0ABIBO = Namespace(%22http://purl.org/ontology/bibo/%22)%0ALOCAL = Namespace(%22http://example.org/ontology/hub#%22)%0A%0Aclass Journal(object):%0A    %22%22%22%0A    http://stackoverflow.com/a/1639197/758157%0A    %22%22%22%0A    def __init__(self, dictionary):%0A        for k, v in dictionary.items():%0A            # Set empty strings to none%0A            if v == '':%0A                v = None%0A            setattr(self, k, v)%0A%0A    def _uri(self):%0A        if self.wosid is None:%0A            import ipdb; ipdb.set_trace()%0A            raise Exception(%22No wosid%22)%0A        return DATA%5Bself.wosid%5D%0A%0A    def to_rdf(self):%0A        uri = self._uri()   %0A        g = Graph()%0A        jr = Resource(g, uri)%0A        jr.set(RDF.type, BIBO.Journal)%0A        jr.set(RDFS.label, Literal(self.title))%0A        jr.set(LOCAL.identifier, Literal(self.wosid))%0A        if self.issn is not None:%0A            jr.set(BIBO.issn, Literal(self.issn))%0A        if self.eissn is not None:%0A            jr.set(BIBO.eissn, Literal(self.eissn))%0A        if self.wikidata is not None:%0A            jr.set(OWL.sameAs, URIRef(self.wikidata))%0A        return g%0A%0Adef main():%0A    g = Graph()%0A    with open(sys.argv%5B1%5D) as csvfile:%0A        for row in csv.DictReader(csvfile):%0A            jrnl = Journal(row)%0A            if jrnl.wosid is None:%0A                continue%0A            g += jrnl.to_rdf()%0A%0A    g.serialize(destination=sys.argv%5B2%5D, format=%22turtle%22)%0A%0Aif __name__ == %22__main__%22:%0A    main()

Add RDF mapping.