{"id":23,"date":"2018-12-13T22:35:41","date_gmt":"2018-12-13T20:35:41","guid":{"rendered":"http:\/\/ma-graph.org\/?page_id=23"},"modified":"2025-06-20T19:17:13","modified_gmt":"2025-06-20T18:17:13","slug":"sparql-endpoint","status":"publish","type":"page","link":"https:\/\/semrepo.org\/index.php\/sparql-endpoint\/","title":{"rendered":"SPARQL"},"content":{"rendered":"\n<p style=\"font-size:clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.098), 15px);px\">The public SPARQL endpoint of the SemRepo Knowledge Graph is provided at <strong><a href=\"https:\/\/semrepo.org\/sparql\">https:\/\/semrepo.org\/sparql<\/a><\/strong><\/p>\n\n\n\n<p style=\"font-size:clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.294), 17px);px\"><strong>Example (Federated) SPARQL queries:<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-4-color\">Programming Languages Used for each topic<\/mark><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\" style=\"border-style:none;border-width:0px;border-radius:0px\"><code>PREFIX rdf: &lt;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#&gt;\nPREFIX foaf: &lt;http:\/\/xmlns.com\/foaf\/0.1\/&gt;\nPREFIX sr: &lt;https:\/\/semrepo.org\/property\/&gt;\nPREFIX srclass: &lt;https:\/\/semrepo.org\/class\/&gt;\n\nSELECT ?topic ?progLang (COUNT(?progLang) AS ?langCount)\nWHERE {\n  GRAPH &lt;https:\/\/semrepo.org&gt; {\n    ?repository rdf:type srclass:repository .\n    ?repository foaf:topic ?topic .\n    ?repository sr:hasLanguageReference ?langref .\n    ?langref sr:hasLanguageName ?progLang .\n  }\n}\nGROUP BY ?topic ?progLang\nORDER BY DESC(?langCount)\nLIMIT 100<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center\"><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-4-color\">Federated query of SemRepo-LinkedPapersWithCode-SemOpenAlex<\/mark><\/em><\/p>\n\n\n\n<p class=\"has-text-align-left\">Retrieve additional metadata about the LPWC repository entity &lt;https:\/\/linkedpaperswithcode.com\/repository\/github.com\/clarinsi\/classla&gt; from SemRepo, Linked Papers With Code, and SemOpenAlex.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\" style=\"border-style:none;border-width:0px;border-radius:0px\"><code>PREFIX dct: &lt;http:\/\/purl.org\/dc\/terms\/&gt;\nPREFIX fabio: &lt;http:\/\/purl.org\/spar\/fabio\/&gt;\nPREFIX owl: &lt;http:\/\/www.w3.org\/2002\/07\/owl#&gt;\nPREFIX lpwc: &lt;https:\/\/linkedpaperswithcode.com\/property\/&gt;\nPREFIX foaf: &lt;http:\/\/xmlns.com\/foaf\/0.1\/&gt;\nPREFIX soa: &lt;https:\/\/semopenalex.org\/ontology\/&gt;\nPREFIX xsd: &lt;http:\/\/www.w3.org\/2001\/XMLSchema#&gt;\nPREFIX sr: &lt;https:\/\/semrepo.org\/property\/&gt;\n\nSELECT ?paper ?paperTitle ?firstAuthor ?firstAuthorName (GROUP_CONCAT(DISTINCT ?institutionName; separator=\", \") AS ?institutionNames) ?url ?stars ?forks ?contributers ?PrimaryLanguageName\nWHERE {\n\nGRAPH &lt;https:\/\/semrepo.org&gt; {\n  ?semrepoRepository fabio:hasURL ?url .\n  ?semrepoRepository sr:hasLpwcUrl &lt;https:\/\/linkedpaperswithcode.com\/repository\/github.com\/clarinsi\/classla&gt; .\n  ?semrepoRepository sr:hasTotalStargazers ?stars .\n  ?semrepoRepository sr:hasTotalForks ?forks .\n  ?semrepoRepository sr:hasTotalContributor ?contributers .\n  ?semrepoRepository sr:hasPrimaryProgrammingLanguage ?primaryLanguageReference .\n  ?primaryLanguageReference sr:hasLanguageName ?PrimaryLanguageName .\n} \n\nSERVICE &lt;https:\/\/linkedpaperswithcode.com\/sparql&gt; {\n  ?paper a &lt;https:\/\/linkedpaperswithcode.com\/class\/paper&gt; .\n  ?paper dct:title ?paperTitle .\n  ?paper lpwc:hasOfficialRepository &lt;https:\/\/linkedpaperswithcode.com\/repository\/github.com\/clarinsi\/classla&gt; .\n  ?paper owl:sameAs ?paperSemOpenAlex .\n}\n  \nSERVICE &lt;https:\/\/semopenalex.org\/sparql&gt; {\n  ?paperSemOpenAlex soa:hasAuthorship ?authorship .\n  ?authorship soa:position \"0\"^^xsd:integer .\n  ?authorship soa:hasAuthor ?firstAuthor .\n  ?firstAuthor foaf:name ?firstAuthorName .\n  ?firstAuthor &lt;http:\/\/www.w3.org\/ns\/org#memberOf&gt; ?firstAuthorInstitution .\n  ?firstAuthorInstitution foaf:name ?institutionName .\n}\n\n}  \nGROUP BY ?paper ?paperTitle ?firstAuthor ?firstAuthorName ?url ?stars ?forks ?contributers ?PrimaryLanguageName\nLIMIT 100<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-center\"><em><mark style=\"background-color:#FFFFFF\" class=\"has-inline-color has-accent-4-color\">Top 5 contributors with most commits with SemOpenAlex profile<\/mark><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\" style=\"border-style:none;border-width:0px;border-radius:0px\"><code>PREFIX sr: &lt;https:\/\/semrepo.org\/property\/&gt;\n\nSELECT ?contributor ?soa_url (SUM(?no_of_commits) AS ?total_commits)\nWHERE {\n  GRAPH &lt;https:\/\/semrepo.org&gt; {\n    ?contRef sr:hasContributor ?contributor .\n    ?contRef sr:hasCommits ?no_of_commits .\n    ?contributor sr:hasSoaUrl ?soa_url .\n  }\n}\nGROUP BY ?contributor ?soa_url\nORDER BY DESC(?total_commits)\nLIMIT 5<\/code><\/pre>\n\n\n\n<p><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-4-color\">Template<\/mark><\/em>: <em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-4-color\">Federated query of SemRepo-<em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-4-color\">LinkedPapersWithCode<\/mark><\/em>-SemOpenAlex<\/mark><\/em><em><mark><\/mark><\/em><\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\" style=\"border-style:none;border-width:0px;border-radius:0px\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-4-color\"><em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-4-color\">PREFIX rdf: &lt;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#&gt;\nPREFIX dct: &lt;http:\/\/purl.org\/dc\/terms\/&gt;\nPREFIX fabio: &lt;http:\/\/purl.org\/spar\/fabio\/&gt;\nPREFIX sr: &lt;https:\/\/semrepo.org\/property\/&gt;\nPREFIX srclass: &lt;https:\/\/semrepo.org\/class\/&gt;\nPREFIX org: &lt;http:\/\/www.w3.org\/ns\/org#&gt;\nPREFIX lpwc: &lt;https:\/\/linkedpaperswithcode.com\/property\/&gt;\n\nSELECT *\nWHERE {\n  GRAPH &lt;https:\/\/semrepo.org&gt; {\n    ?SemRepo_repository rdf:type srclass:repository .\n    ?SemRepo_repository fabio:hasURL ?Github_Url .\n    ?SemRepo_repository sr:hasTotalStargazers ?Stars .\n    ?SemRepo_repository sr:hasTotalWatchers ?Watchers .\n    ?SemRepo_repository sr:hasTotalForks ?Forks .\n    ?SemRepo_repository sr:hasTotalContributor ?Contributor .\n    ?SemRepo_repository sr:hasTotalIssues ?TotalIssues .\n    ?SemRepo_repository sr:hasLpwcUrl ?Lpwc_repository .\n    ?SemRepo_repository dct:creator ?SemRepo_person .\n    ?SemRepo_person sr:hasSoaUrl ?Soa_Author .\n  }\n\n  SERVICE &lt;https:\/\/semopenalex.org\/sparql&gt; {\n    ?Soa_Author org:memberOf ?Institution .\n  } \n\n  SERVICE &lt;https:\/\/linkedpaperswithcode.com\/sparql&gt; {\n    ?Lpwc_paper lpwc:hasOfficialRepository ?Lpwc_repository .\n    ?Lpwc_paper lpwc:hasTask ?Lpwc_Task .\n    ?Lpwc_paper lpwc:hasMethod ?Lpwc_Method .\n    ?Lpwc_paper lpwc:hasEvaluation ?Lpwc_Evaluation .\n    ?Lpwc_paper lpwc:hasConference ?Lpwc_Conference .\n  } \n}\nLIMIT 100<\/mark><\/em><\/mark><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The public SPARQL endpoint of the SemRepo Knowledge Graph is provided at https:\/\/semrepo.org\/sparql Example (Federated) SPARQL queries: Programming Languages Used for each topic Federated query of SemRepo-LinkedPapersWithCode-SemOpenAlex Retrieve additional metadata about the LPWC repository entity &lt;https:\/\/linkedpaperswithcode.com\/repository\/github.com\/clarinsi\/classla&gt; from SemRepo, Linked Papers With Code, and SemOpenAlex. Top 5 contributors with most commits with SemOpenAlex profile Template: Federated [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-23","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/semrepo.org\/index.php\/wp-json\/wp\/v2\/pages\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/semrepo.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/semrepo.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/semrepo.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/semrepo.org\/index.php\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":26,"href":"https:\/\/semrepo.org\/index.php\/wp-json\/wp\/v2\/pages\/23\/revisions"}],"predecessor-version":[{"id":484,"href":"https:\/\/semrepo.org\/index.php\/wp-json\/wp\/v2\/pages\/23\/revisions\/484"}],"wp:attachment":[{"href":"https:\/\/semrepo.org\/index.php\/wp-json\/wp\/v2\/media?parent=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}