Exemple #1
0
def existing_faculty_info():
	"""
	Get all faculty info that might be replaced
	with data coming from FIS.
	"""
	q = """
	CONSTRUCT {
	    ?fac a vivo:FacultyMember ;
	    	 a blocal:BrownThing ;
	             rdfs:label ?label ;
	             foaf:firstName ?first ;
	             foaf:lastName ?last ;
	             vivo:preferredTitle ?title ;
	             vivo:primaryEmail ?email ;
	             blocal:shortId ?shortId ;
	             blocal:fisUpdated ?updated .
	}
	WHERE {
		?fac a blocal:BrownThing ;
		     a vivo:FacultyMember ;
			rdfs:label ?label ;
            foaf:firstName ?first ;
            foaf:lastName ?last ;
            vivo:preferredTitle ?title ;
            vivo:primaryEmail ?email ;
            blocal:shortId ?shortId .
        OPTIONAL {
        	?fac blocal:fisUpdated ?updated .
        }
	}
	"""
	rg = vstore.query(q)
	return rg.graph
Exemple #2
0
def existing_faculty_set():
	"""
	Query the vstore and get all shortIds for
	exiting faculty.
	"""
	q = """
	SELECT ?fac ?shortId
	WHERE {
		?fac a blocal:BrownThing ;
		     a vivo:FacultyMember ;
			 blocal:shortId ?shortId .
	}
	"""
	if DEBUG is True:
		q += "LIMIT 10"
	out = set()
	for row in vstore.query(q):
		out.add(row.shortId.toPython())
	return out