# Query #1 # Count student courses: the number of courses students have taken, classified by the student’s # department, university, and advisor PREFIX lubm: PREFIX rdf: SELECT ?dp ?udp ?ad (COUNT(?co) AS ?stCoCount) WHERE{ ?st rdf:type lubm:Student ; lubm:memberOf ?dp ; lubm:takesCourse ?co ; lubm:advisor ?ad . ?dp rdf:type lubm:Department ; lubm:subOrganizationOf ?udp . ?udp rdf:type lubm:University . ?ad rdf:type lubm:Faculty . ?co rdf:type lubm:Course . } GROUP BY ?dp ?udp ?ad # Query #2 # Count faculty member courses: the number of courses faculty members teach, classified by the department # which they are a member of and the university the department is in . PREFIX lubm: PREFIX rdf: SELECT ?dp ?udp (COUNT(?co) AS ?coCount) WHERE{ ?lc rdf:type lubm:Professor . lubm:worksFor ?dp ; lubm:teacherOf ?co . ?dp rdf:type lubm:Department ; lubm:subOrganizationOf ?udp . ?udp rdf:type lubm:University . ?co rdf:type lubm:Course . } GROUP BY ?dp ?udp # Query #3 # Count research assistant courses: the number of courses research assistants have taken, # classified by the department they work for, the university of that department, and their advisor. PREFIX lubm: PREFIX rdf: SELECT ?dp ?udp ?ad (COUNT(?co) AS ?raCoCount) WHERE{ ?ra rdf:type lubm:ResearchAssistant ; lubm:memberOf ?dp ; lubm:takesCourse ?co; lubm:advisor ?ad . ?dp rdf:type lubm:Department ; lubm:subOrganizationOf ?udp . ?udp rdf:type lubm:University . ?ad rdf:type lubm:Professor . ?co rdf:type lubm:Course . } GROUP BY ?dp ?udp ?ad # Query #4 # Count graduate courses taught by professors : the number of graduate courses professors teach, classified # by the professor’s department and the university for which she works. PREFIX lubm: PREFIX rdf: SELECT ?dp ?udp (COUNT(?gco) AS ?gcoCount) WHERE{ ?pr rdf:type lubm:Professor ; lubm:worksFor ?dp ; lubm:teacherOf ?gco . ?dp rdf:type lubm:Department ; lubm:subOrganizationOf ?udp . ?udp rdf:type lubm:University . ?udg rdf:type lubm:University . ?gco rdf:type lubm:GraduateCourse . } GROUP BY ?dp ?udp ?udg # Query# 5 # Count department courses: the number of courses offered by department, classified # by the department and the university of the department. PREFIX lubm: PREFIX rdf: SELECT ?dp ?udp (COUNT(?co) AS ?taCoCount) WHERE{ ?prof lubm:worksFor ?dp ; lubm:teacherOf ?co . ?dp rdf:type lubm:Department ; lubm:subOrganizationOf ?udp . ?udp rdf:type lubm:University . ?co rdf:type lubm:Course . } GROUP BY ?dp ?udp ORDER BY ?udp ?dp # Query #6 # Count the number of final exams a faculty member should grade if every course's final evaluation is an exam, classified # by faculty, her department, the university for which she works. PREFIX lubm: PREFIX rdf: SELECT ?pr ?dp ?udp (COUNT(?co) AS ?taCoCount) WHERE{ ?st lubm:takesCourse ?co . ?pr lubm:teacherOf ?co . ?pr lubm:worksFor ?dp . ?co rdf:type lubm:Course . ?dp rdf:type lubm:Department ; lubm:subOrganizationOf ?udp . ?udp rdf:type lubm:University . } GROUP BY ?pr ?dp ?udp ORDER BY ?udp ?dp ?pr