<commit_before>/*
 * (c) Copyright 2005 Hewlett-Packard Development Company, LP
 * All rights reserved.
 * [See end of file]
 */

package org.joseki.soap;


import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;

import org.apache.axis.MessageContext;
import org.apache.axis.handlers.soap.SOAPService;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.SOAPBody;
import org.apache.axis.message.Text;
import org.apache.axis.types.NMToken;
import org.apache.axis.types.URI;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joseki.Dispatcher;
import org.joseki.Request;
import org.joseki.ReturnCodes;
import org.joseki.processors.SPARQL;

import org.w3.www._2001.sw.DataAccess.rf1.result2.*;
import org.w3.www._2001.sw.DataAccess.sparql_protocol_types.* ;


/** The implementation of SPARQL protocol over SOAP */

public class SPARQL_P
{
    static private Log log = LogFactory.getLog(SPARQL_P.class) ; 
    
    static { Dispatcher.initServiceRegistry() ; } 
    
    public QueryResult query(Query request) throws java.rmi.RemoteException
    {
        if ( log.isDebugEnabled() )
            log.debug("SOAP request received") ;
        try {
            // Axis has already parsed the message into nice Java datastructures.  
            MessageContext cxt = MessageContext.getCurrentContext() ;
            cxt.setProperty("disablePrettyXML", new Boolean(false)) ;
            
            if ( true )
            {<commit_msg>*** empty log message ***<commit_after>/*
 * (c) Copyright 2005 Hewlett-Packard Development Company, LP
 * All rights reserved.
 * [See end of file]
 */

package org.joseki.soap;


import java.io.File;
import java.io.IOException;

import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;

import org.apache.axis.MessageContext;
import org.apache.axis.handlers.soap.SOAPService;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.SOAPBody;
import org.apache.axis.message.Text;
import org.apache.axis.types.NMToken;
import org.apache.axis.types.URI;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joseki.Dispatcher;
import org.joseki.Request;
import org.joseki.ReturnCodes;
import org.joseki.processors.SPARQL;

import org.w3.www._2001.sw.DataAccess.rf1.result2.*;
import org.w3.www._2001.sw.DataAccess.sparql_protocol_types.* ;


/** The implementation of SPARQL protocol over SOAP */

public class SPARQL_P
{
    static private Log log = LogFactory.getLog(SPARQL_P.class) ; 
    
    static boolean initialized = false ;
    
    public static void init()
    {
        if ( initialized )
            return ;
        
        initialized = true ;
        File f = new File(".") ;
        // Because user.dir may have been changed. 
        log.info("File base: "+f.getAbsolutePath()) ;
        try{
            log.info("File base: "+f.getCanonicalPath()) ;
        } catch (IOException ex)
        {
            log.info("File base 9absolute path): "+f.getAbsolutePath()) ;
        }
        //log.info("user.dir = "+System.getProperty("user.dir")) ;
        
        // Initialize the service registry (ir it is not already initialized)
        Dispatcher.initServiceRegistry() ;
    }

    public QueryResult query(Query request) throws java.rmi.RemoteException
    {
        init() ;
        if ( log.isDebugEnabled() )
            log.debug("SOAP request received") ;
        try {
            // Axis has already parsed the message into nice Java datastructures.  
            MessageContext cxt = MessageContext.getCurrentContext() ;
            cxt.setProperty("disablePrettyXML", new Boolean(false)) ;
            
            if ( true )
            {
{'fraction_non_alphanumeric': 0.1145311381531854, 'fraction_numerical': 0.007874015748031496, 'mean_word_length': 2.9772296015180264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3854595', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1306, 'n_words': 274}