Query Endpoint

Permanent Link of Query Endpoint is : http://aseg.cs.concordia.ca/secold/sparql


Try the following link to access the Graphical User Interface SPARQL query:

Second Query Endpoint (for beginners - limited data access to sample data)  :
If you are intrested to send standard query request via HTTP messages try our Standard Sparql Endpoint (Warning, there is no GUI)




SeCold 2.0 Sample Query


Free Text Search on Source Code

SELECT ?line ?variation ?content
     WHERE
     ?line <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/Line>
     ?line fti:match 'keyword' 
     ?line <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasContent> ?content
     ?variation <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasLine> ?line . 
     } limit 2



Integration of SeClone and SeCold for Code Clone and Pattern Search/Detection

SELECT ?line ?variation ?content 
    WHERE { 
    ?line <http://aseg.cs.concordia.ca/ontologies/2012/6/clon/PATTERN SEARCH TYPE PLACEHOLDER> "SeCloneSimCode" . 
    ?line <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasContent> ?content . 
    ?variation <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasLine> ?line . 
    }
* hasSeclone_w_TLS_SimCode is an example for PATTERN SEARCH TYPE PLACEHOLDER feild.




SeCold 1.0 Sample Query (Do NOT try these queries on the server since these are obsolete)

Please note, some of these queries might take a few minutes. Please wait for your result.

Find projects with BSD license and have at least a Java class which imports java.util.Collection 

select ?project where{
  ?variation <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasLine> ?line .
   ?line <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasSourceCode> ?statement .
  ?statement <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/importedType> <http://aseg.cs.concordia.ca/secold/resource/fqn/java/java.util.Collection> .
  ?project <http://aseg.cs.concordia.ca/ontologies/2010/11/veron/hasSnapshot> ?snapshot .
  ?snapshot <http://aseg.cs.concordia.ca/ontologies/2010/11/veron/hasVariation> ?variation .
  ?project <http://dbpedia.org/ontology/license> <http://dbpedia.org/resource/BSD>.
}

limit 1

Find Java classes which import javax.jdo.Query 

select ?variation where{
  ?variation <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasLine> ?line .
   ?line <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasSourceCode> ?statement .
  ?statement <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/importedType> <http://aseg.cs.concordia.ca/secold/resource/fqn/java/javax.jdo.Query> .
  
}

limit 3

Defined Class names (FQN) under BSD license (based on the project's license)

select ?project  ?fqn where {
    ?project <http://aseg.cs.concordia.ca/ontologies/2010/11/veron/hasSnapshot> ?snapshot .
  ?snapshot <http://aseg.cs.concordia.ca/ontologies/2010/11/veron/hasVariation> ?variation .
  ?project <http://dbpedia.org/ontology/license> <http://dbpedia.org/resource/BSD>.
  ?variation <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasLine> ?line .
  ?line <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasSourceCode>  ?classstmt .
 ?classstmt <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasFQN> ?fqn .
 ?classstmt  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/ClassDeclarationStmt> .
limit 1


A simple query to show how to access file-level license information

select ?file ?license where 
{?file <http://aseg.cs.concordia.ca/ontologies/2010/11/licenson/hasLicense> ?license limit 20


A complex query to show how to mix file-level license information with different resources

select ?variation where{
  ?variation <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasLine> ?line .
   ?line <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasSourceCode> ?statement .
  ?statement <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/importedType> <http://aseg.cs.concordia.ca/secold/resource/fqn/java/java.util.Collection> .
 ?variation <http://aseg.cs.concordia.ca/ontologies/2010/11/licenson/hasLicense> <http://aseg.cs.concordia.ca/ontologies/2010/11/resource/license/all_rights_reserved_f> .
limit 1

 


A query that shows how to mix file-level fingerprint and license information to find copyright violations

select ?a ?b ?la ?lb ?x  where 
  ?a <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/testxi> ?x 
  ?b <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/testxi> ?x 
  ?a<http://aseg.cs.concordia.ca/ontologies/2010/11/licenson/hasLicense> ?la 
  ?b <http://aseg.cs.concordia.ca/ontologies/2010/11/licenson/hasLicense> ?lb 
  Filter ?x !"0" && ?a !?b && ?la !?lb}  limit 10


The following query is a really cool and useful one but it is too heavy for our current server (hardware) so please do not run it on our public sparql endpoint. If you are interested to see the result, you can download the dataset and run it locally.



A class that is defined under  BSD license and it is used (imported) in another class under  Apache_license license 

select ?project  ?fqn where {
    ?project <http://aseg.cs.concordia.ca/ontologies/2010/11/veron/hasSnapshot> ?snapshot .
  ?snapshot <http://aseg.cs.concordia.ca/ontologies/2010/11/veron/hasVariation> ?variation .
  ?project <http://dbpedia.org/ontology/license> <http://dbpedia.org/resource/BSD>.
  ?variation <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasLine> ?line .
  ?line <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasSourceCode>  ?classstmt .
 ?classstmt <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasFQN> ?fqn .
 ?classstmt  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/ClassDeclarationStmt> .
  
   ?projectB <http://aseg.cs.concordia.ca/ontologies/2010/11/veron/hasSnapshot> ?snapshotB .
  ?snapshotB <http://aseg.cs.concordia.ca/ontologies/2010/11/veron/hasVariation> ?variationB .
  ?projectB <http://dbpedia.org/ontology/license>  <http://dbpedia.org/resource/Apache_license> .
   ?variationB <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasLine> ?lineB .
   ?lineB <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/hasSourceCode> ?statementB .
  ?statementB <http://aseg.cs.concordia.ca/ontologies/2010/11/socon/importedType> ?fqn .
 
limit 1





Sample query from DBPedia:
Comments