Internal Server Error with Custom Mapping File


We are trying to create a virtual graph from a custom SMS mapping file and it is throwing Internal Server Error without any specific reasons, we have also gone through the logs and no comprehensive explanation is provided.

Sharing the details .

SMS Mapping ,


MAPPING :frpm_Mapping
{ SELECT * from CDESchools.frpm }
TO {
?frpm rdf:type sac:frpm .
?frpm sac:Academic%20Year ?academic_year .
?frpm sac:County%20Code ?county_code .
?frpm sac:District%20Code ?district_code .
?frpm sac:School%20Code ?school_code .
?frpm sac:County%20Name ?county_name .
?frpm sac:District%20Name ?district_name .
?frpm sac:School%20Name ?school_name .
?frpm sac:District%20Type ?district_type .
?frpm sac:School%20Type ?school_type .
?frpm sac:Educational%20Option%20Type ?educational_option_type .
?frpm sac:NSLP%20Provision%20Status ?nslp_provision_status .
?frpm sac:Charter%20School%20(Y/N) ?charter_school__y_n_ .
?frpm sac:Charter%20School%20Number ?charter_school_number .
?frpm sac:Charter%20Funding%20Type ?charter_funding_type .
?frpm sac:IRC ?irc .
?frpm sac:Low%20Grade ?low_grade .
?frpm sac:High%20Grade ?high_grade .
?frpm sac:Enrollment%20(K-12) ?enrollment__k_12_ .
?frpm sac:Free%20Meal%20Count%20(K-12) ?free_meal_count__k_12_ .
?frpm sac:Percent%20(%)%20Eligible%20Free%20(K-12) ?percent_____eligible_free__k_12_ .
?frpm sac:FRPM%20Count%20(K-12) ?frpm_count__k_12_ .
?frpm sac:Percent%20(%)%20Eligible%20FRPM%20(K-12) ?percent_____eligible_frpm__k_12_ .
?frpm sac:Enrollment%20(Ages%205-17) ?enrollment__ages_5_17_ .
?frpm sac:Free%20Meal%20Count%20(Ages%205-17) ?free_meal_count__ages_5_17_ .
?frpm sac:Percent%20(%)%20Eligible%20Free%20(Ages%205-17) ?percent_____eligible_free__ages_5_17_ .
?frpm sac:FRPM%20Count%20(Ages%205-17) ?frpm_count__ages_5_17_ .
?frpm sac:Percent%20(%)%20Eligible%20FRPM%20(Ages%205-17) ?percent_____eligible_frpm__ages_5_17_ .
?frpm sac:2013-14%20CALPADS%20Fall%201%20Certification%20Status ?2013_14_calpads_fall_1_certification_status .
?frpm sac:CDSCode ?cdscode .
?frpm sac:ref_CDSCode ?ref_cdscode .
BIND (TEMPLATE ('{CDSCode}') AS ?frpm)
BIND (TEMPLATE ('{CDSCode}') AS ?ref_cdscode)

MAPPING :satscores_Mapping
{ SELECT * from CDESchools.satscores }
TO {
?satscores rdf:type sac:satscores .
?satscores sac:rtype ?rtype .
?satscores sac:sname ?sname .
?satscores sac:dname ?dname .
?satscores sac:cname ?cname .
?satscores sac:enroll12 ?enroll12 .
?satscores sac:NumTstTakr ?numtsttakr .
?satscores sac:AvgScrRead ?avgscrread .
?satscores sac:AvgScrMath ?avgscrmath .
?satscores sac:AvgScrWrite ?avgscrwrite .
?satscores sac:NumGE1500 ?numge1500 .
?satscores sac:PctGE1500 ?pctge1500 .
?satscores sac:cds ?cds .
?satscores sac:ref_cds ?ref_cds .
BIND (TEMPLATE ('{cds}') AS ?satscores)
BIND (TEMPLATE ('{cds}') AS ?ref_cds)

MAPPING :schools_Mapping
{ SELECT * from CDESchools.schools }
TO {
?schools rdf:type sac:schools .
?schools sac:CDSCode ?cdscode .
?schools sac:NCESDist ?ncesdist .
?schools sac:NCESSchool ?ncesschool .
?schools sac:StatusType ?statustype .
?schools sac:County ?county .
?schools sac:District ?district .
?schools sac:School ?school .
?schools sac:Street ?street .
?schools sac:StreetAbr ?streetabr .
?schools sac:City ?city .
?schools sac:Zip ?zip .
?schools sac:State ?state .
?schools sac:MailStreet ?mailstreet .
?schools sac:MailStrAbr ?mailstrabr .
?schools sac:MailCity ?mailcity .
?schools sac:MailZip ?mailzip .
?schools sac:MailState ?mailstate .
?schools sac:Phone ?phone .
?schools sac:Ext ?ext .
?schools sac:Website ?website .
?schools sac:OpenDate ?opendate .
?schools sac:ClosedDate ?closeddate .
?schools sac:Charter ?charter .
?schools sac:CharterNum ?charternum .
?schools sac:FundingType ?fundingtype .
?schools sac:DOC ?doc .
?schools sac:DOCType ?doctype .
?schools sac:SOC ?soc .
?schools sac:SOCType ?soctype .
?schools sac:EdOpsCode ?edopscode .
?schools sac:EdOpsName ?edopsname .
?schools sac:EILCode ?eilcode .
?schools sac:EILName ?eilname .
?schools sac:GSoffered ?gsoffered .
?schools sac:GSserved ?gsserved .
?schools sac:Virtual ?virtual .
?schools sac:Magnet ?magnet .
?schools sac:Latitude ?latitude .
?schools sac:Longitude ?longitude .
?schools sac:AdmFName1 ?admfname1 .
?schools sac:AdmLName1 ?admlname1 .
?schools sac:AdmEmail1 ?admemail1 .
?schools sac:AdmFName2 ?admfname2 .
?schools sac:AdmLName2 ?admlname2 .
?schools sac:AdmEmail2 ?admemail2 .
?schools sac:AdmFName3 ?admfname3 .
?schools sac:AdmLName3 ?admlname3 .
?schools sac:AdmEmail3 ?admemail3 .
?schools sac:LastUpdate ?lastupdate .
BIND (TEMPLATE ('{CDSCode}') AS ?schools)

And this is not just for one data source , it is occurring for multiple data sources.
Would appreciate your assistance to understand and solve the issue .


Hi Dipanjan,

seems like you need to URL-encode the parenthesis in your mappings, ie ( and ). For example, sac:Charter%20School%20(Y/N) is not valid in the mapping. In that particular IRI, you also might want to replace the "/" with another character.

Best regards

Hi Lars,

Thanks for the comment, I understand this might be an issue with special characters, but there are other schemas also which have internal server error. Can specific reason why these errors occur ?

Hi Dipanjan,

without any further details, I cannot diagnose the issues with your mappings. The error messages usually provide the line and the column where the error occurs including a brief description of the error. You can use that information to resolve the issues with your mappings. Syntactic errors in the mappings should also be marked in the mapping editor of Studio (underlined in red). Other issues might be missing tables or columns in the data source of your VG.

Best regards